home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / utils2 / pwrbat22.zip / POWERBAT.DOC < prev    next >
Text File  |  1994-05-18  |  125KB  |  5,136 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                                     PowerBatch
  11.                                   Version 2.2
  12.  
  13.  
  14.  
  15.                          COMPUTING SYSTEMS DESIGN, INC.
  16.                                4437 Ormond Trace
  17.                                Marietta, GA 30066
  18.                                FAX (404) 926-9590
  19.  
  20.  
  21.                       Copyright (c) 1990-1993 by CSD, Inc.
  22.                          All Rights Reserved Worldwide
  23.  
  24.                This documentation was produced on April 25, 1994
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                                Table Of Contents
  31.  
  32.  
  33.                 Introduction   . . . . . . . . . . . . . . . . . . . . . . .  1
  34.  
  35.                 Software Support   . . . . . . . . . . . . . . . . . . . . .  3
  36.  
  37.                 Concept Of Operation   . . . . . . . . . . . . . . . . . . .  4
  38.  
  39.                 Installation   . . . . . . . . . . . . . . . . . . . . . . .  6
  40.  
  41.                 Constructing A PowerBatch Source File  . . . . . . . . . . . .  7
  42.  
  43.                 PowerBatch Commands  . . . . . . . . . . . . . . . . . . . . .  9
  44.  
  45.                 Command Summary  . . . . . . . . . . . . . . . . . . . . . . 85
  46.  
  47.                 Compilation Errors   . . . . . . . . . . . . . . . . . . . . 87
  48.  
  49.                 Examples   . . . . . . . . . . . . . . . . . . . . . . . . . 90
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                                   Introduction
  56.         PowerBatch is the extension of an original product, PowerBatch,  written
  57.         in late 1989. This product was originally written to provide the user
  58.         an alternative to the standard DOS batch files, an alternative that
  59.         produced standalone executable .EXE programs. The original command set
  60.         was aimed primarily at providing capabilities that solved the classic
  61.         "batch" type application.
  62.  
  63.         Requests from current users of the product and a desire to provide
  64.         additional capabilities beyond these requests have driven the product
  65.         far beyond original expectations. This product has become not only a
  66.         replacement for solving the classic batch application, but a very high
  67.         level language capable of creating sophisticated applications.
  68.  
  69.         PowerBatch compiled programs create all the details that are necessary
  70.         to create a professional microcomputer program. When you execute one
  71.         of the PB+ high level commands such as SaveBox, all of the details
  72.         such as memory allocation in the heap area, saving not only the data
  73.         on the screen, but also the color attributes and the cursor location
  74.         are handled just by the invocation of the command. When you execute
  75.         the RestBox command, you do not have to keep track of any of these
  76.         details. PB+ will simply restore the screen area of the last area
  77.         stored and will know where in the heap memory this data is stored,
  78.         move the data, and free up the heap memory that was used.
  79.  
  80.         This product is intended to provide a novice or beginning programmer
  81.         the capability of producing non-trivial programs with a high success
  82.         rate AND providing the experienced programmer with a tool which makes
  83.         quick work of the task of prototyping new applications.
  84.  
  85.         Trademarks
  86.         ==========
  87.         PowerBatch is a trademark of Computing Systems Design(CSD), Inc.
  88.         MS-DOS is a trademark of MicroSoft Corporation.
  89.         IBM and PC-DOS are trademarks of IBM Corporation.
  90.  
  91.  
  92.         License Agreement
  93.         =================
  94.         a. You are granted a personal, non-transferable and  non-exclusive
  95.         license to use the Program under the terms stated in this Agreement.
  96.         Title and ownership of the Program and documentation remain in CSD,
  97.         Inc.;
  98.  
  99.         b. the Program may be used by you, your employees, or your agents only
  100.  
  101.  
  102.                                     Page 1
  103.  
  104.  
  105.  
  106.  
  107.  
  108.         on a single computer;
  109.  
  110.         c. you and your employees and agents are required to protect the
  111.         confidentiality of the Program. You may not distribute or otherwise
  112.         make the Program or documentation available to any third party;
  113.  
  114.         d. you may not copy or reproduce the Program or documentation for any
  115.         purpose, except you may copy the Program into machine readable or
  116.         printed form for backup purposes in support of your use of the
  117.         Program. (Any portion of this Program merged into or used in
  118.         conjunction with another program will continue to be the property of
  119.         CSD, Inc. and subject to the terms and condition of this Agreement);
  120.  
  121.         e. you may not assign or transfer this Program or this license to any
  122.         other person without the express prior consent of CSD, Inc.;
  123.  
  124.         f. you acknowledge that you are receiving only a limited license to
  125.         use the program and the related documentation. You acknowledge that
  126.         CSD, Inc. retains title to the Program and documentation.  You
  127.         acknowledge that CSD, Inc. has a valuable proprietary interest in the
  128.         Program and documentation; and
  129.  
  130.         You must reproduce and include the copyright notice on any copy,
  131.         modification or portion merged into another program with the exception
  132.         of compiled executable modules produced from your own source input.
  133.         You may modify the Program for your own use, entirely at your own
  134.         risk, provided that the Program is used as specified in Section (b) of
  135.         this Agreement.
  136.  
  137.         Output from the PowerBatch compiler generated from original source code
  138.         become the property of the license holder and CSD, Inc. retains no
  139.         rights nor demands any royalty from their use.
  140.  
  141.         YOU MAY NOT USE, MODIFY, OR TRANSFER THE PROGRAM, OR ANY COPY,
  142.         MODIFICATION OR MERGED PORTION, IN WHOLE OR IN PART, EXCEPT AS
  143.         EXPRESSLY PROVIDED FOR IN THIS LICENSE.
  144.  
  145.         IF YOU TRANSFER POSSESSION OF ANY COPY, MODIFICATION OR MERGED PORTION
  146.         OF THE PROGRAM TO ANOTHER PARTY, YOUR LICENSE IS AUTOMATICALLY
  147.         TERMINATED.
  148.  
  149.         TERM
  150.         The license is effective until terminated.  You may terminate it at
  151.         any other time by destroying the Program together with all copies,
  152.         modifications and merged portion in any form.  It will also terminate
  153.  
  154.  
  155.                                     Page 2
  156.  
  157.  
  158.  
  159.  
  160.  
  161.         upon conditions set forth elsewhere in the Agreement or if you fail to
  162.         comply with any term or condition of the Agreement.  You agree upon
  163.         such termination to destroy the Program together with all copies,
  164.         modifications and merged portions in any form.
  165.  
  166.         Software Support
  167.         ================
  168.         Support for PowerBatch may be obtained by contacting CSD, Inc. on
  169.         Compuserve using Compuserve Mail (EasyPlex). Address inquiries to
  170.         Compuserve ID 72701,155. If you are not a Compuserve member, you may
  171.         obtain support by writing to:
  172.  
  173.                             Computing Systems Design, Inc.
  174.                                   4437 Ormond Trace
  175.                                Marietta, Georgia 30066
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.                                     Page 3
  209.  
  210.  
  211.  
  212.  
  213.  
  214.                               Concept Of Operation
  215.  
  216.         PowerBatch is a compiler for a very high level language. A high level
  217.         language is one which requires a small number of commands to generate
  218.         code to perform a task. This is at the opposite end of the spectrum
  219.         from a low level language which requires a large number of commands to
  220.         perform a specified task. Low level languages allow the programmer to
  221.         operate at the "bits and bytes" level but generally requires a high
  222.         level of familiarity with both the computer and the language itself.
  223.         Low level languages generally produce code segments that are of
  224.         minimum size and maximum speed. High level languages produce solutions
  225.         that are easier and quicker to develop with some compromise in size
  226.         and speed.
  227.  
  228.         PowerBatch has attempted to make development of executable modules as
  229.         easy as possible and produce modules that are fast in execution. PB
  230.         Plus+ is a development tool that will allow experienced programmers to
  231.         develop applications in a minimum of time. It is designed to introduce
  232.         non-programmers to the creative world of programming. Error checking
  233.         and all the details that the experienced programmer builds into a
  234.         professional program are included automatically in every PowerBatch
  235.         compiled module.
  236.  
  237.         In addition to the more than 100 commands in the PowerBatch language,
  238.         any valid executable command (.EXE & .COM) as well as any of the DOS
  239.         intrinsic commands are valid within a PowerBatch source file and will be
  240.         "compiled". These .EXE, .COM and DOS intrinsic commands will be
  241.         executed via a shell and the PowerBatch .EXE program will continue
  242.         execution with the next compiled statement following the shelled
  243.         command. There are two main modules supplied with PowerBatch;
  244.         1)PBPLUS.EXE and 2)SMLMODEL.MDL. PBPLUS reads, parses the source file,
  245.         and compiles the source code extracting routines from SMLMODEL. The
  246.         result is a completely standalone .EXE file that executes without
  247.         SMLMODEL or PowerBatch.
  248.  
  249.         PowerBatch commands fall into 5 classes of commands;
  250.  
  251.               1) Commands which provide systems information. These commands
  252.               provide the current color settings, the current date, the
  253.               current time, check for the existence of a valid drive letter,
  254.               and commands which check for the existence of a directory or a
  255.               file.
  256.  
  257.               2) Commands which control the flow of the program. Execute
  258.               different portions of the program based on existence or non-
  259.  
  260.  
  261.                                     Page 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.               existence of directories or files. Compare the contents of one
  268.               variable with the contents of another variable or a constant
  269.               and execute different portions of the batch program based on
  270.               the results of the compare.
  271.  
  272.               3) Commands which read and write strings of text.  These strings
  273.               of text may be "records" written to a disk as a file or
  274.               elements of an array written to a dynamically expanding array
  275.               in the memory area outside of the compiled program.
  276.  
  277.               4) Commands which provide string manipulation. Change a string to
  278.               all upper case characters, or all lower case characters.
  279.               Extract a portion of a string such as the first three
  280.               characters or the last four characters. Build a new string from
  281.               two existing strings by concatenation of the two strings.
  282.  
  283.               5) Commands which deal with screen writing and input from the
  284.               keyboard. These commands are the main power in the PowerBatch
  285.               system. Directly address any position on the screen and move
  286.               the cursor to that position to read or write text.
  287.               Automatically center a message or title on any line. Draw boxes
  288.               around portions of the screen to enhance screen appearance.
  289.               Read a single key from the keyboard, read the response to a
  290.               query that only accepts a yes or no response, read a string of
  291.               characters from the keyboard with a specified maximum length,
  292.               and read keys from the keyboard automatically changing the
  293.               characters to upper case.
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.                                     Page 5
  315.  
  316.  
  317.  
  318.  
  319.  
  320.                                      Installation
  321.  
  322.         Installation is accomplished by executing the PBInstal program. It
  323.         seemed only fitting that this install program be a compiled PowerBatch
  324.         program.  The two main modules PB PLUS.EXE and SMLMODEL.MDL must be
  325.         located in the DOS path to allow you to compile PowerBatch programs from
  326.         any directory on your system. PowerBatch may be run on a system as small
  327.         as a single floppy drive system with 128K. There will be some limit to
  328.         the number of source statements that may be compiled on a system this
  329.         small as memory is dynamically allocated as compilation progresses. A
  330.         source file of several hundred statements can be compiled on a small
  331.         machine. The PBInstal program is strictly a file copy program. It will
  332.         ask you where you wish to place the PowerBatch files and copy them to
  333.         the specified directory. You may copy your own files to various
  334.         directories if you desire. You may even copy PBPLUS.EXE and
  335.         SMLMODEL.MDL to a directory not on your path if you desire. If you do
  336.         so, you may compile only from the directory containing these two
  337.         files.
  338.  
  339.         PowerBatch may be installed from either drive A or B.
  340.  
  341.         Place your PowerBatch installation disk in either drive A or drive B.
  342.         Change to the drive which contains the install disk by typing
  343.            A: <Enter>
  344.         or
  345.            B: <Enter>
  346.  
  347.         Run the installation program by entering
  348.  
  349.            PBINSTAL <Enter>
  350.  
  351.         Follow the onscreen instructions to copy both the compiler and the
  352.         example files to your disk. Remember that you must copy both
  353.         PBPLUS.EXE  and  SMLMODEL.MDL to a directory defined to be in the DOS
  354.         search path in order to compile programs from any directory. If you do
  355.         not place these programs in a directory on the search path, you will
  356.         be able to compile from only the directory where they reside.
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.                                     Page 6
  368.  
  369.  
  370.  
  371.  
  372.  
  373.                          Constructing A PowerBatch Source File
  374.  
  375.         Use your favorite text editor to create a printable ASCII file
  376.         containing PowerBatch source commands and DOS executable commands. A
  377.         printable ASCII file is one that may be typed to the screen (i.e. type
  378.         myfile.pwr <enter>) and the results printed on the screen contain only
  379.         the file contents. Most files created with a word processor are not
  380.         printable ASCII files unless you specify an ASCII file output option.
  381.  
  382.         Compile your source statements to create a .EXE executable module.
  383.         This is done using the PowerBatch compiler. The syntax is:
  384.  
  385.            PBPlus MyFile [OutFile] [+M] [+D2] [+O]
  386.  
  387.         PowerBatch assumes the extension of the input file to be .PWR (i.e.
  388.         MYFILE.PWR) and will create an output file of MYFILE.EXE if no OutFile
  389.         parameter is specified. The input source file may be any DOS name of
  390.         your choice (including the extension). You may also specify an output
  391.         file name of your choice but the extension will always be .EXE. If you
  392.         do not enter the input file name on the command line, the program will
  393.         prompt you for the name. You must at this time enter the complete name
  394.         including the extension.
  395.  
  396.         If you wish to generate a list of all literals, variables, and labels
  397.         used in your PowerBatch program, add +M to the end of the command line.
  398.         This variable map will be written to the [FileName].MAP file.
  399.  
  400.         If you will be running the output from the compilation on any computer
  401.         that is operating under a version of DOS that is earlier than DOS
  402.         version 3.0, you must enter the compiler directive +D2. This directive
  403.         will cause the compilation to be much slower but the resulting .EXE
  404.         file will execute on computers running on DOS 3.0 and up at the SAME
  405.         SPEED as compilations made without the +D2 directive. If in doubt, use
  406.         +D2. A minute of compile time will eliminate future problems. If you
  407.         compile a program that has been compiled before and has generated an
  408.         .EXE file, you will be asked if you wish to replace this EXE file. To
  409.         compile in batch mode or to bypass this message use the overwrite parm
  410.         +O.
  411.  
  412.         If the compiler finds no compilation errors, the compiled version of
  413.         your source file will be generated. For an explanation of compilation
  414.         errors, see the section entitled "Compilation Errors". Compilation
  415.         errors appear on your screen as they are encountered and they are
  416.         written to a file named [FileName].MAP (i.e. if your input file name
  417.         is MYFILE.PWR, the error and map file will be MYFILE.MAP). The entire
  418.  
  419.  
  420.                                     Page 7
  421.  
  422.  
  423.  
  424.  
  425.  
  426.         source code is scanned each time you compile a PowerBatch program (i.e.
  427.         the compiler does not stop when an error is found, but attempts to
  428.         identify all errors on each pass). This means that some errors will be
  429.         the result of previous errors found in the source.
  430.  
  431.         If there are no compilation errors, the [FileName].MAP file will not
  432.         be created.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.                                     Page 8
  474.  
  475.  
  476.  
  477.  
  478.  
  479.                                   PowerBatch Commands
  480.  
  481.         Commands, Variable Names, and Labels are not case sensitive.
  482.         Everything on the command source line is converted to upper case
  483.         except a literal which is enclosed within quotes. Either single
  484.         quotes(') or double quotes(") may be used to denote a literal.
  485.         Literals which are numeric such as color values, variable lengths,
  486.         etc. should not be enclosed in quotes. The compiler does evaluate each
  487.         literal (both alpha and numeric) in the same manner. The evaluation
  488.         process is 1) remove leading and trailing quotes if any, 2) attempt to
  489.         convert literal to numeric, 3) if numeric conversion is successful,
  490.         consider it a number, 4) if numeric conversion is unsuccessful,
  491.         consider it alpha numeric. This means that internally an operand of 3
  492.         and "3" will both be numeric.
  493.  
  494.         A semicolon which is not enclosed within quotes or a part of a command
  495.         is used to denote a comment. Semicolons which are part of a command
  496.         must not be preceded by a space. A comment begins with a semicolon
  497.         which follows a space not within quotes. Comments may appear anywhere
  498.         on the command line, but everything after a semicolon on a command
  499.         line is ignored. A comment may begin in column 1 by placing the
  500.         semicolon in column 1. The following are NOT comments:
  501.  
  502.            path=d:\;c:\util;c:\wp
  503.            path   "d:\;c:\util;c:\wp"
  504.            WriteLine   "Punctuation may be used within quotes;"
  505.  
  506.         These ARE comments:
  507.  
  508.            Variable ColorSave,3 ;save the original color
  509.            SetVar   Msg, ErrMsg ;set Msg to "Invalid input"
  510.  
  511.         The starting location on the command line of the command and the
  512.         operands is not important and tabs and spaces may be freely used for
  513.         readability.
  514.  
  515.         Variable names and command labels may be any length in the source but
  516.         are significant only through the first eight positions. This means
  517.         that any variable name or label that is equal in the first 8 positions
  518.         will be considered the same.
  519.  
  520.         Variables, Literals, and Labels
  521.  
  522.         Variables
  523.         A variable is a location in memory that you allocate and give a name
  524.  
  525.  
  526.                                     Page 9
  527.  
  528.  
  529.  
  530.  
  531.  
  532.         and a maximum length. Anytime you refer to the "name" of the variable,
  533.         you are referencing the memory locations set aside for this variable.
  534.         Variable names give you an easy way to manipulate data internally
  535.         within the computer. The following are examples of variables:
  536.  
  537.            Variable    CharIn,1
  538.  
  539.         This variable gives the name "CharIn" to one memory position. It might
  540.         be used to hold one character responses from the keyboard by the user.
  541.  
  542.  
  543.            Variable    PBDir,79
  544.  
  545.         This variable appears in the PBInstal program and holds the name of
  546.         the directory where the PowerBatch compiler will be placed. It is
  547.         composed of the drive letter and directory entered by the user in
  548.         response to two questions during the installation process.
  549.  
  550.            Variable    CompName,35,"The ABC Company"
  551.  
  552.         This variable reserves 35 positions in memory and gives these
  553.         locations the name CompName. The PowerBatch compiler also places the
  554.         initial value "The ABC Company" in the first 15 positions of the
  555.         variable. The value of this variable may be changed by later
  556.         processing in the program. When this variable is referenced in the
  557.         program it will contain only 15 characters (The ABC Company) with no
  558.         leading or trailing spaces, assuming the program has not assigned a
  559.         new value.
  560.  
  561.            Variable    MsgClear,20,"                    "
  562.  
  563.         This variable contains 20 spaces and is named MsgClear. It will be
  564.         used to "clear" or overwrite with spaces an error message in your
  565.         program. Once you have displayed a message to the user, it should be
  566.         cleared as you continue with the program. This is done by overwriting
  567.         with spaces. Having a variable with the correct number of spaces makes
  568.         this task easier.
  569.  
  570.  
  571.  
  572.         Literals
  573.         Literals are very much like variables which have a value but no name.
  574.         Literals are used in PowerBatch commands when you wish to pass an actual
  575.         value to the command instead of a variable. Note in the following
  576.         examples that literals containing numbers only are not enclosed in
  577.  
  578.  
  579.                                     Page 10
  580.  
  581.  
  582.  
  583.  
  584.  
  585.         quotes and literals containing any non-numeric characters are enclosed
  586.         in quotes. If you specify a number as a literal, either convention is
  587.         acceptable (3 or "3"). If you specify alphabetic characters, the
  588.         quotes are required. For readability, and ease of entry, numeric
  589.         literals usually do not contain quotes. Examine the following examples
  590.         of literals:
  591.  
  592.            Center      "Installation Program",1
  593.  
  594.         This command will center the literal "Installation Program" on line 1
  595.         of the screen. The text "Installation Program" must appear somewhere
  596.         in the program and it appears as a literal. It will occupy memory
  597.         positions and will have a value but you may not reference this value
  598.         by name. By instructing the compiler to write this literal, the
  599.         compiler automatically creates the memory locations and initial value
  600.         but gives it no name. The 1 is also a literal in this command. Each
  601.         time you use a literal in a PowerBatch program, the previously assigned
  602.         literals are checked for duplication and if the literal has been
  603.         previously assigned, the prior assignment will be used (i.e. literal
  604.         values will appear only one time regardless of the number of times
  605.         used).
  606.  
  607.            WriteAt     12,3,Msg1
  608.  
  609.         There are two literals in this command. The numbers 12 and 3 are both
  610.         created as literals. In this command they specify the column and row
  611.         location where the string Msg1 will be written. Again, the compiler
  612.         creates the memory locations and values for these literals, but no
  613.         names. If you were to write another command such as the Beep command
  614.         which specifies that the system speaker will beep at a certain
  615.         frequency for 3 times, the compiler will find the previously defined
  616.         literal "3" and use this value instead of creating another literal.
  617.  
  618.            Beep        ErrTone,8,3
  619.  
  620.         This is the Beep command referenced in the previous example. The beep
  621.         command will cause the speaker to sound at a frequency of ErrTone for
  622.         .8 second and repeat 3 times. The "3" literal will use the same memory
  623.         location reference as the WriteAt command used in the previous command
  624.         (i.e. another literal will not be created).
  625.  
  626.         Labels
  627.  
  628.  
  629.  
  630.  
  631.  
  632.                                     Page 11
  633.  
  634.  
  635.  
  636.  
  637.  
  638.         Labels are names of a particular place in your PowerBatch program that
  639.         you will go to without executing the previous command. You go directly
  640.         to this location in the program from another location in the program
  641.         based on a decision you have made in the code flow. Examples will help
  642.         explain:
  643.  
  644.            ReadYN      "Do you wish to continue [Y/N] ",InChar
  645.            Compare     InChar,"Y",,,GetDrive
  646.            Halt        999      ;end the program if "N"
  647.  
  648.            Label       GetDrive
  649.  
  650.         This group of commands writes the message on the screen and asks the
  651.         user to input either Y or N (the command will only accept these two
  652.         characters). A comparison is then made to a literal "Y" and the
  653.         compare command will jump to the location in the program named
  654.         GetDrive if a "Y" was entered or will execute the next command if "N"
  655.         was entered.
  656.            GoTo        NextCmd
  657.            .
  658.            .
  659.            .
  660.            Label       NextCmd
  661.  
  662.         In this most straightforward use of the label, the user simply uses
  663.         the GoTo command and jumps unconditionally to another point in the
  664.         program.
  665.  
  666.         External Commands
  667.         External commands are entered just as PowerBatch commands are entered.
  668.         If you enter an external command and this command uses command line
  669.         parameters, these parameters may be passed as either variables or
  670.         literals. Remember that if the parameter is not numeric, it must be
  671.         enclosed in quotes or it will be treated as a variable. Any PowerBatch
  672.         statement which is an external command may contain a maximum of 7
  673.         command line variables. That is not to say that you may not pass more
  674.         than 7 command line parameters to an external program but that these
  675.         command line variables may not be contained in more that 7 PowerBatch
  676.         variables.
  677.  
  678.         For example:
  679.            Variable Parm1,5,"one"
  680.            Variable Parm2,5,"two"
  681.            Variable Parm3,5,"three"
  682.            Variable Parm4,5,"four"
  683.  
  684.  
  685.                                     Page 12
  686.  
  687.  
  688.  
  689.  
  690.  
  691.                            Variable Parm5,5,"five"
  692.            Variable Parm6,5,"six"
  693.            Variable Parm7,5,"seven"
  694.            Variable Parm8,5,"eight"
  695.            Variable BigParm,80
  696.  
  697.            ExtPgm   (Name of an external program)
  698.  
  699.         A valid method for passing these parms in one PowerBatch parameter.
  700.  
  701.            Extpgm   "one two three four five six seven eight"
  702.  
  703.         Accomplishing the same thing with variables using 6 PowerBatch parms.
  704.  
  705.            Concat   BigParm,Parm1," "
  706.            Concat   BigParm,Parm2
  707.            Concat   BigParm," "
  708.            Concat   BigParm,Parm3
  709.            ExtPgm   BigParm,Parm4,Parm5,Parm6,Parm7,Parm8
  710.  
  711.         Examples of external programs as PowerBatch commands:
  712.  
  713.            Variable    InChar,1
  714.            ReadYN      "Do you wish a directory ",InChar
  715.            Compare     InChar,"Y",NextSec,NextSec
  716.            DIR         "/W"
  717.            SETUP    "> null"    ;printer redirection
  718.  
  719.            Variable    PgmName,12
  720.            Write    "Enter program name to compile "
  721.            ReadStr     PgmName
  722.            TPC         PgmName, "/ddebug"
  723.  
  724.         This third example of external commands show the use of two predefined
  725.         variables, ERRORLEVEL and DOSERROR. After the execution of "TestPgm",
  726.         we examine DOSError to find if the program executed OK (Possibly there
  727.         was not enough memory or the program could not be found on the DOS
  728.         path). After determining that the program executed OK, we examine the
  729.         exit code set by "TestPgm" to determine the flow of the remainder of
  730.         our program. This exit code will be found in the variable ERRORLEVEL.
  731.  
  732.            Variable    MsgLine,80
  733.            .
  734.            .
  735.            TestPgm     "Parm1 Parm2"
  736.  
  737.  
  738.                                     Page 13
  739.  
  740.  
  741.  
  742.  
  743.  
  744.                            Compare     DOSError,0,,,RanOK
  745.            WriteLine      "TestPgm did not execute properly"
  746.            Halt        DOSError
  747.            Label    RanOK
  748.            Compare     ErrorLevel,1,Chk2,,Option1
  749.            Concat      MsgLine,"Unexpected code : ",ErrorLevel
  750.            Halt
  751.            Label       Option1
  752.  
  753.         Note: PowerBatch programs may be executed by other PowerBatch programs as
  754.         external commands. An option of the PowerBatch Halt command is to set
  755.         the DOS errorlevel. You could then "pass parameters" from one PowerBatch
  756.         program to another via the ERRORLEVEL variable.
  757.  
  758.         Command Line Parameters
  759.         Command line parameters may be passed to a compiled PowerBatch program.
  760.         These command line parameters must be defined at compile time and have
  761.         special variable names. Up to 16 parameters may be passed to a PB
  762.         Plus+ program. These parameters are named CLP%1 - CLP%16.
  763.         If you wish to pass parameters on the command line to your PowerBatch
  764.         program, define the command line parameter variables (CLP%1 - CLP%16)
  765.         in your PowerBatch source prior to compilation and when you run the
  766.         compiled program, any parameters entered on the command line will be
  767.         in the defined variable. Example:
  768.  
  769.            Source for SMARTCPY.PWR
  770.  
  771.            Variable    CLP%1,79    ;source file
  772.            Variable    CLP%2,79    ;target file
  773.            Variable    InChar,1
  774.            ReadYN      "Ready to copy the files [Y/N] ",InChar
  775.            Compare     InChar,"Y",NoCopy,NoCopy
  776.            COPY        CLP%1, CLP%2
  777.  
  778.         SMARTCPY FILE1 FILE2 will execute the DOS copy command and copy FILE1
  779.         to FILE2 if the user responds Y to the question.
  780.  
  781.         Changing Environment Variables
  782.  
  783.         Your computer memory contains a special area of memory called the
  784.         "Environment Area". This special area of memory contains the values
  785.         assigned to variables that are available to the DOS operating system
  786.         or to any application program running in your computer. These values
  787.         remain unchanged until DOS or an application program changes them. DOS
  788.         maintains special values in this area which the operating system uses.
  789.  
  790.  
  791.                                     Page 14
  792.  
  793.  
  794.  
  795.  
  796.  
  797.         Your current path and current prompt configuration are two of these
  798.         values. These values are normally set with the DOS PROMPT or PATH
  799.         command. If an application program like a compiled PowerBatch program
  800.         executes a DOS command, it is done via a "shell" or another copy of
  801.         your command processor (normally COMMAND.COM) which is started to
  802.         handle the execution of these DOS commands. When a shell is started,
  803.         DOS creates a copy of the environment area for this new shell and
  804.         makes the environment values available to the shell. Unfortunately,
  805.         when the shell is terminated (when the DOS command is complete) this
  806.         copy of the environment is erased from memory. If you execute a
  807.         PROMPT, PATH or SET [Variable] command, the copy of the environment
  808.         created for the shell to run the PROMPT, PATH, or SET command is
  809.         updated and immediately erased when the PowerBatch program is finished.
  810.         PowerBatch however, provides you a means to update both the permanent
  811.         copy and the current copy of the environment area with the commands
  812.         SETPATH, SETENV, and PROMPT.
  813.  
  814.         Unfortunately, problems dealing with the environment area do not end
  815.         here. When DOS runs a program (like a PowerBatch compiled program), a
  816.         copy of the permanent environment is made and is the "active"
  817.         environment area in use during the running of the program. If you only
  818.         read the values of existing environment variables, there is no
  819.         problem. If you attempt to add new environment values, the amount of
  820.         free environment space is very limited. IT IS NOT THE AMOUNT OF SPACE
  821.         ALLOCATED BY YOU IN YOUR CONFIG.SYS FILE (or the default) MINUS THE
  822.         AMOUNT OF USED SPACE! The amount of "free" space appears to be only
  823.         the amount left after rounding up the amount of used space to the
  824.         nearest paragraph of memory (16 bytes).
  825.         The problem of allocating environment free space can be circumvented
  826.         by updating the permanent environment area with dummy values prior to
  827.         the execution of your PowerBatch file. This could be done with a small
  828.         PowerBatch program such as ENV-INIT.PWR as follows:
  829.  
  830.            SetEnv   Env1,'dummy value dummy value'
  831.            SetEnv   Env2,'dummy value dummy value'
  832.            .
  833.            .
  834.            .
  835.         When ENV-INIT terminates, the environment variables Env1 and Env2 will
  836.         have the dummy values and will now be a part of any environment area
  837.         copy passed to a running program. You could of course use the DOS SET
  838.         command from the DOS command line or initialize the environment
  839.         variables with dummy values in your AUTOEXEC.BAT file.
  840.  
  841.         Command Notation
  842.  
  843.  
  844.                                     Page 15
  845.  
  846.  
  847.  
  848.  
  849.  
  850.         In the description of the commands which follow, that which appears
  851.         within brackets [ ] is optional and all other operands are required.
  852.         Any time a screen color may be specified in a command such as
  853.  
  854.            CLEARLINE LineNum,ForegrClr,BackgrClr
  855.  
  856.         the single attribute which is used in many color conventions may be
  857.         substituted for the pair of color attributes. For example, foreground
  858.         color 4 (red), background color 1 (blue), is identical to color
  859.         attribute 20 and the CLEARLINE command may be specified EITHER as
  860.  
  861.            CLEARLINE 14,4,1
  862.         or
  863.            CLEARLINE 14,20
  864.  
  865.         to clear line 14 on the screen to red foreground on blue background.
  866.         For this reason anytime that the operand pair of foreground color,
  867.         background color is required, the single color attribute may be
  868.         substituted for the pair. The compiler will not detect missing
  869.         background color attributes but will assume that the foreground is the
  870.         composite value.
  871.  
  872.         How do I calculate this color attribute? The composite color attribute
  873.         is the DOS shorthand method of keeping both the foreground and
  874.         background colors in one byte of memory. It may be calculated by
  875.         multiplying the background color by 16 and adding the foreground
  876.         color. See Appendix B for a complete list of composite color
  877.         attributes.
  878.  
  879.         Color Attribute = (Backgrnd X 16) + Foregrnd
  880.         RedOnBlue = (1 X 16) + 4 = 20
  881.         WhiteOnBlack = (0 X 16) + 7 = 7
  882.         YellowOnRed = (4 X 16) + 14 = 78
  883.         DOS uses the ASCII values 0 through 127 for all the colors available.
  884.         To make any color blink, add 128 to the color value.
  885.  
  886.         YellowOnRed,Blinking = 78 + 128 = 206.
  887.  
  888.         Command Syntax
  889.  
  890.         Several examples are available on the distribution disk. All source
  891.         code examples have a file extension of .PWR. These examples may be
  892.         edited with your favorite text editor and printed by "copying" the
  893.         file to the printer such as COPY PBINSTAL.PWR LPT1.
  894.  
  895.  
  896.  
  897.                                     Page 16
  898.  
  899.  
  900.  
  901.  
  902.  
  903.                        ?COLOR Foreground, Background, Composite
  904.  
  905.         Retrieve the current color attributes from the system and place the
  906.         current foreground color in ForeGround, the current background color
  907.         in BackGround, and the composite attribute in Composite. The
  908.         relationship is Composite = (BackGround * 16) + ForeGround. See
  909.         Appendix B for complete list of composite color attributes.
  910.  
  911.               Variable ForeColor,3
  912.               Variable BackColor,3
  913.               Variable ColorAttr,3
  914.               ?Color   ForeColor,BackColor,ColorAttr
  915.  
  916.         Retrieve the current foreground, background and composite color values
  917.         and place in the variables ForeColor, BackColor, and ColorAttr
  918.         respectively. To create professional programs it is a good idea to
  919.         retrieve the current color setting as the first command in the program
  920.         and reset these values and clear the screen at the end of your
  921.         program. This restores the users computer to the same color state that
  922.         you found when your PowerBatch program was executed.
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.                                          Page 17
  951.  
  952.  
  953.  
  954.  
  955.  
  956.                           ?CURRDIR CurrDrive, CurrDirectory
  957.  
  958.         Retrieve the current drive and directory from the system and place the
  959.         current drive in CurrDrive and the current directory in CurrDirectory.
  960.         The contents of CurrDrive prior to execution of this command control
  961.         which drive is searched for the currently logged directory. If
  962.         ?CurrDir finds a valid drive letter in the first position of
  963.         CurrDrive, then the contents of CurrDirectory will be the currently
  964.         logged directory of that drive. If the first position of CurrDrive
  965.         does not contain a valid drive letter, then CurrDirectory will contain
  966.         the currently logged directory of the current drive. In either case
  967.         CurrDrive will contain the drive and CurrDirectory will contain the
  968.         directory.
  969.  
  970.            Variable    CurrDrive,2
  971.            Variable    CurrDir,79
  972.            SetVar      CurrDrive,"A"
  973.            ?CurrDir    CurrDrive,CurrDir
  974.            SetVar      CurrDrive,""
  975.            ?CurrDir    CurrDrive,CurrDir
  976.  
  977.         In the first usage of ?CurrDir, assuming that the currently logged
  978.         directory on the A drive is the root directory, CurrDrive will contain
  979.         "A" and CurrDir will contain "\" after the execution of ?CurrDir. In
  980.         the second usage, assuming that the currently logged drive is D: and
  981.         the currently logged directory on the D: drive is "\UTIL\EXEC",
  982.         CurrDrive will contain "D" and CurrDir will contain "\UTIL\EXEC" after
  983.         the execution of ?CurrDir.
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.                                     Page 18
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.                           ?DATE DayOfWeek, Month, Day, Year
  1010.  
  1011.         Retrieve the current date from the system and place the day of the
  1012.         week in DayOfWeek, the month in Month, the day in Day, and the 4 digit
  1013.         year in Year. DayOfWeek should be defined as 9 long, Month and Day as
  1014.         2 long, and Year as 4 long.
  1015.  
  1016.            Variable DOW,9
  1017.            Variable Mo,2
  1018.            Variable Da,2
  1019.            Variable Yr,4
  1020.            ?Date DOW,Mo,Da,Yr
  1021.  
  1022.         Retrieve the current date and place the component parts in their
  1023.         respective variables. Place the day of the week in DOW (i.e.
  1024.         Saturday), the month number in Mo (i.e. 06), the day of the month in
  1025.         Da (i.e. 29), and the year in Yr (i.e. 1993).
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.                                     Page 19
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.                       ?DIREXIST DirName, FoundLbl [,NotFoundLbl]
  1063.  
  1064.         Check the system for the existence of the directory whose name appears
  1065.         in DirName. If the directory exists go directly to the label FoundLbl,
  1066.         if the directory does not exist, go directly to the label NotFoundLbl.
  1067.         DirName may either be a variable or a literal. If NotFoundLbl is not
  1068.         specified, execution will continue with the next instruction
  1069.         immediately following the ?DirExist command.
  1070.  
  1071.            ?DirExist   InpStr,DirOk,BadDir
  1072.            ?DirExist   "C:\",DirOK,BadDir
  1073.            ?DirExist   InpStr,,BadDir  (next command if exists)
  1074.            ?DirExist   InpStr,DirOk    (next command if not exist)
  1075.  
  1076.         In the first example if the contents of the variable InpStr exists
  1077.         then goto label DirOK, if it does not exist go to the label BadDir. In
  1078.         the second example we check for the existence of a directory contained
  1079.         in the literal whose value is "C:\". In the third example, if the
  1080.         contents of InpStr exist we "fall through" to the next instruction, if
  1081.         the directory does not exist we jump to the label BadDir. In the
  1082.         fourth example, if the directory name in InpStr exists, we jump to the
  1083.         label DirOK, if it does not exist we fall through to the next command.
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.                                     Page 20
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.                                                ?DISKINFO DriveLetter, VolID, DriveType
  1116.  
  1117.         The volume ID is retrieved from the DriveLetter drive and the type of
  1118.         drive is determined and placed in DriveType. Volume ID may be a string
  1119.         of up to 12 characters. All disk media is not required to contain a
  1120.         Volume ID and in this case VolID will contain "No Label". The
  1121.         DriveType will be one of the following values:
  1122.            "360 Floppy"      "720 Floppy"      "1.2 Floppy"
  1123.            "1.4 Floppy"      "Other Floppy" "Bernoulli"
  1124.            "HardDisk"     "RamDisk"      "SubDrive"
  1125.            "Unknown"      "Invalid"
  1126.  
  1127.            Variable Drive,1,'D'
  1128.            Variable VolumeID,12
  1129.            Variable DriveType,12
  1130.  
  1131.            ?DiskInfo   Drive,VolumeID,DriveType
  1132.            Compare  DriveType,'RamDisk',,,RamOK
  1133.            Write Drive
  1134.            WriteLine   ' is not a RAM drive!'
  1135.            Halt
  1136.  
  1137.            Label RamOK
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.                                     Page 21
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.                     ?DISKSPACE DriveLetter, TotalSpace, FreeSpace
  1169.  
  1170.         Query the disk Drive specified by the first character of DriveLetter
  1171.         and place the total disk capacity in bytes in TotalSpace and the
  1172.         unused bytes in FreeSpace. Since the command looks at only the first
  1173.         character of DriveLetter, this parameter may contains strings such as
  1174.         "C:\UTIL". DriveLetter may be either a Variable or a Literal.
  1175.  
  1176.            Variable    DirName,79
  1177.            Write    'Enter your full pathname'
  1178.            ReadStr     DirName  (user enters "c:\util")
  1179.            ?DiskSpace  DirName,TotSpace,FreeSpace
  1180.  
  1181.         This will place the total capacity of drive C: in the variable
  1182.         TotSpace and the amount of this space that is unused in the variable
  1183.         FreeSpace.
  1184.  
  1185.            ?DiskSpace  "A",TotSpace,FreeSpace
  1186.  
  1187.         This retrieves the total capacity and free space for drive A:  using a
  1188.         literal of "A".
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.                                     Page 22
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.                  ?DRIVEEXIST DriveLetter, ValidLabel [,InvalidLabel]
  1222.  
  1223.         Check the system for DriveLetter as a valid drive. If the drive is
  1224.         valid, jump to Label1, if the drive is not valid, jump to Label2. If
  1225.         InvalidLabel is not specified, execution will continue with the next
  1226.         command immediately following the ?DriveExist command. DriveLetter may
  1227.         be either a variable or a literal.
  1228.  
  1229.            ?DriveExist DrvNum,GoodDrv,BadDrv
  1230.            ?DriveExist "A",GoodDrv,BadDrv
  1231.            ?DriveExist DrvNum,,BadDrv (falls thru if drive ok)
  1232.            ?DriveExist DrvNum,GoodDrv (falls thru if drive bad)
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.                                     Page 23
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.                        ?ENVSTR EnvironName, EnvironNameContents
  1275.  
  1276.         Retrieve the contents of any environment variable from the system
  1277.         environment area. The name of the environment variable is placed in
  1278.         EnvironName or entered as a literal and the contents of the
  1279.         environment variable will be placed in EnvironNameContents. Ensure
  1280.         that EnvironNameContents has been defined long enough to contain the
  1281.         contents of the environment variable. If EnvironNameContents is not
  1282.         long enough, the environment variable will be truncated. To display
  1283.         the currently defined environment variables, use the DOS "SET" command
  1284.         at a DOS prompt. (i.e. C:>SET <enter>) You should receive at least two
  1285.         environment variables (assuming you have set a path) with the format
  1286.         NAME=VALUE. The location of your command processor is in an
  1287.         environment variable named COMSPEC and should look something like
  1288.         this: COMSPEC=C:\COMMAND.COM.
  1289.  
  1290.            Variable    EnvValue,255
  1291.            Variable    EnvName,4,"path"
  1292.            ?EnvStr     "prompt", EnvValue
  1293.            ?EnvStr     EnvName, EnvValue
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.                                     Page 24
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.                    ?FILEEXIST FileName, FoundLabel [,NotFoundLabel]
  1328.  
  1329.         Check the system for the specified file name. If the file exists, jump
  1330.         to the label FoundLabel, if the file does not exist, jump to the label
  1331.         NotFoundLabel. If NotFoundLabel is not entered, execution will
  1332.         continue with the next command immediately following the ?FileExist
  1333.         command. If only a file name is entered (i.e. CONFIG.SYS), then only
  1334.         the current directory will be searched. If a fully qualified filename
  1335.         is entered (i.e. C:\CONFIG.SYS), then only the specified directory
  1336.         will be searched. FileName may be either a variable or a literal. See
  1337.         ?FileExpand.
  1338.  
  1339.            ?FileExist  FileName, Label1, Label2
  1340.            ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  1341.            ?FileExist  FileName,,NotFound
  1342.            ?FileExist  FileName,Found
  1343.  
  1344.         The two commands ?FileExist and ?FileExpand are identical with the
  1345.         exception that ?FileExist gives you the capability to limit your
  1346.         search to the current directory while ?FileExpand will attempt to find
  1347.         the file anywhere on the disk and tell you exactly where the file was
  1348.         found.
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.                                     Page 25
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.                   ?FILEEXPAND FileName, FoundLabel [,NotFoundLabel]
  1381.  
  1382.         Check the system for the specified file name. If the file exists, jump
  1383.         to the label FoundLabel, if the file does not exist, jump to the label
  1384.         NotFoundLabel. If NotFoundLabel is not entered, execution will
  1385.         continue with the next command immediately following the ?FileExist
  1386.         command. If FileName contains a drive and/or path in addition to the
  1387.         filename (i.e. C:\CONFIG.SYS or \CONFIG.SYS), the specified drive and
  1388.         directory is searched. If only a filename is placed in FileName, then
  1389.         the search contains the following: 1) the current directory, 2) the
  1390.         directory from which the compiled PowerBatch program was run, 3) all
  1391.         directories on the search path. (I try to find it in any directory on
  1392.         the disk which I know exists). If the file was found, the full path
  1393.         name\filename is placed in FileName. For this reason FileName must be
  1394.         a variable. Ensure that FileName is long enough to handle this full
  1395.         pathname!
  1396.  
  1397.            SetVar      FileName,'MYFILE.LTR'
  1398.            ?FileExist  FileName, Label1, Label2
  1399.  
  1400.         Assuming that MYFILE.DAT was located in "\WP60\LETTERS", the contents
  1401.         of FileName will be "C:\WP60\LETTERS\MYFILE.LTR".
  1402.  
  1403.            ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  1404.  
  1405.         ERROR! FileName cannot be a literal.
  1406.  
  1407.         The two commands ?FileExist and ?FileExpand are identical with the
  1408.         exception that ?FileExist gives you the capability to limit your
  1409.         search to the current directory while ?FileExpand will attempt to find
  1410.         the file anywhere on the disk and tell you exactly where the file was
  1411.         found.
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.                                     Page 26
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.                              ?FILESIZE FileSize, FileName
  1434.  
  1435.         The size in bytes of FileName is placed in FileSize. FileName may be
  1436.         either a variable or a literal. FileSize must be a variable.
  1437.  
  1438.            Variable FileSize,11
  1439.            Variable FileName,'AUTOEXEC.BAT'
  1440.  
  1441.            CD    'C:\'       ;change drive and dir
  1442.            ?FileSize   FileSize, FileName   ;find the filesize
  1443.            ?FileSize   FileSize, 'AUTOEXEC.BAT' ;same results
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.                                     Page 27
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.                     ?INPATH DirName, FoundLabel, [,NotFoundLabel]
  1487.  
  1488.         Compare the contents of DirName to the system search path. If DirName
  1489.         is contained within the path, jump to the label FoundLabel, if DirName
  1490.         is not contained within the path, jump to the label NotFoundLabel. If
  1491.         NotFoundLabel is not specified, execution will continue with the
  1492.         command immediately following the ?InPath command. Use this command to
  1493.         determine if a directory is located in the DOS search path.
  1494.  
  1495.            DOS search path contains "C:\UTIL;C:\WORDPROC;D:\"
  1496.            Variable    InString,79
  1497.            Write    "Enter your directory name "
  1498.            ReadStr     InString (user enters "c:\wordproc")
  1499.            Upper    InString (change to "C:\WORDPROC")
  1500.            ?InPath     InString,PathOK,BadPath
  1501.  
  1502.            ?InPath     "C:\UTIL",,BadPath   (compare literal)
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.                                     Page 28
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.                                   ?TIME CurrentTime
  1540.  
  1541.         Retrieve the current time from the system and place in CurrentTime.
  1542.         The format of the time is hh:mm:ss xm. CurrentTime should be defined
  1543.         as 11 long.
  1544.  
  1545.            Variable CurrTime,11
  1546.            ?Time CurrTime (now contains 11:24:14 am)
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                     Page 29
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.                         ADD Sum, Number, [RtnCode], [Decimals]
  1593.  
  1594.         Add the contents of Number to Sum and place the result in Sum. RtnCode
  1595.         will contain zero (0) if the add command completed without error.
  1596.         Decimals contains the number of decimal places for the result. If
  1597.         Decimals is not specified, zero decimal places will be assumed and
  1598.         integer arithmatic will be performed. Your Result will be rounded to
  1599.         the specified number of decimal places.  Accurate to 18 significant
  1600.         digits.
  1601.  
  1602.            Variable    YLoc,2
  1603.            SetVar      YLoc,6
  1604.            Label    LoopCtr
  1605.            ClearLine      YLoc,Blue
  1606.            Add         YLoc,1
  1607.            Compare     YLoc,11,LoopCtr
  1608.  
  1609.         This small code segment will clear lines 6 through 10 on your screen
  1610.         by incrementing the line number variable used by the ClearLine
  1611.         command.
  1612.  
  1613.         Using decimals with PowerBatch math...
  1614.  
  1615.            Variable    AcctBal,12,'127,854.94'
  1616.            Variable    RtnCode,1
  1617.            Add         AcctBal,'122.125',RtnCode,4
  1618.            Compare     RtnCode,0,ErrRtn
  1619.            Write    AcctBal     (contains 127977.065)
  1620.            Multiply    AcctBal,'.000325',RtnCode,6
  1621.            Compare     RtnCode,0,ErrRtn
  1622.            Write    AcctBal     (contains 41.592546)
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.                                     Page 30
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.                           BEEP Frequency, Duration [,Repeat]
  1646.  
  1647.         Sound the system speaker with a tone of Frequency, for a length of
  1648.         Duration tenths of a second, and repeat Repeat times.
  1649.  
  1650.            Beep  800,5,3
  1651.            Beep  ErrFreq,BeepLen,ErrTimes
  1652.  
  1653.         The first example sounds the system speaker at a frequency of 800 hz
  1654.         for half a second (.5) and repeats twice for a total of 3 times. The
  1655.         second example will sound the system speaker at a frequency equal to
  1656.         the contents of the variable ErrFreq for BeepLen tenths of a second(s)
  1657.         for a total of ErrTimes.
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.                                     Page 31
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.                                         BLINK
  1699.  
  1700.         Cause all text that is written to the screen to blink using the
  1701.         current color attributes last defined in the processing of the your
  1702.         program. This command in "undone" by using NORMAL.
  1703.  
  1704.            Variable MsgClear,25."                         "
  1705.            Blink
  1706.            WriteAt  15,4,"Not a valid entry"
  1707.            Normal
  1708.            Wait     35
  1709.            WriteAt  15,4,MsgClear
  1710.  
  1711.         Write the message "Not a valid entry" at column 15 on row 4 using the
  1712.         current color definition. Reset the text color to the value it
  1713.         contained before specifying blinking text. Wait 3.5 seconds and clear
  1714.         the message.
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.                                     Page 32
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.                                          BOOT
  1752.  
  1753.         This command will cause the computer to perform a "warm" boot. This
  1754.         emulates the pressing of the Alt-Ctrl-Del key combination.
  1755.  
  1756.            ReadYN   'Press Y to REBOOT your machine (Y/N) ',YNInput
  1757.            Compare  YNInput,'Y',NoBoot,NoBoot
  1758.            Boot
  1759.            Label NoBoot
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.                                     Page 33
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.                        BOXx UX, UY, LX, LY, ForeClr [,BackClr]
  1805.  
  1806.         Where Boxx is Box0 thru Box3. Draw a box (frame) on the screen whose
  1807.         upper left coordinates (X,Y) are UX,UY, and whose lower right
  1808.         coordinates (X,Y) are LX,LY. Draw the box using a line in foreground
  1809.         color ForeClr on background color BackClr. The border line for the box
  1810.         is:
  1811.            Box0 - No border
  1812.            Box1 - Single line
  1813.            Box2 - Double line
  1814.            Box3 - Heavy solid line.
  1815.         The interior of the box is cleared to the background color whether
  1816.         specified explicitly by the background color parameter or as a part of
  1817.         the composite color parameter. The cursor is positioned at UX+1, UY+1.
  1818.  
  1819.            Variable ULX,2,5     ;upper left col value
  1820.            Variable ULY,2,3     ;upper left row value
  1821.            Variable LRX,2,75    ;lower right col value
  1822.            Variable LRY,2,20    ;lower right row value
  1823.            Variable BoxFore,2,4 ;foreground color red
  1824.            Variable BoxBack,2,0 ;background color black
  1825.            Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1826.            Box1     5,3,75,20,7,0
  1827.            Box1     5,3,75,20,112
  1828.  
  1829.         The first example draws a box whose upper left coordinates are the
  1830.         contents of the variables ULX and ULY and whose lower left coordinates
  1831.         are the contents of the variables LRX and LRY. The box border will be
  1832.         the contents of BoxFore (red) on a background of BoxBack (black).  The
  1833.         second example draws a box whose upper left coordinates are 5,3 and
  1834.         whose lower right coordinates are 75,20. The box border is drawn in
  1835.         white on black. The third example draws a box with the same
  1836.         coordinates and uses the composite color attribute of 112 (white on
  1837.         black). See ClearBox command.
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.                                     Page 34
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.                  BOX4 UX, UY, LX, LY, ForeClr [,BackClr] [,ShadowClr]
  1858.  
  1859.         Draw a box (frame) on the screen whose upper left coordinates (X,Y)
  1860.         are UX,UY, and whose lower right coordinates (X,Y) are LX,LY. Draw the
  1861.         box using a line in foreground color ForeClr on background color
  1862.         BackClr. The border line for the box is single line with a transparent
  1863.         shadow. The shadow color is ShadowClr.
  1864.  
  1865.         The interior of the box is cleared to the background color whether
  1866.         specified explicitly by the background color parameter or as a part of
  1867.         the composite color parameter. The cursor is positioned at UX+1, UY+1.
  1868.  
  1869.            Variable ULX,2,5     ;upper left col value
  1870.            Variable ULY,2,3     ;upper left row value
  1871.            Variable LRX,2,75    ;lower right col value
  1872.            Variable LRY,2,20    ;lower right row value
  1873.            Variable BoxFore,2,4 ;foreground color red
  1874.            Variable BoxBack,2,0 ;background color black
  1875.            Variable Shadow,2,8  ;shadow color
  1876.            Box1     ULX,ULY,LRX,LRY,BoxFore,BoxBack,Shadow
  1877.  
  1878.  
  1879.         This example draws a box whose upper left coordinates are the contents
  1880.         of the variables ULX and ULY and whose lower left coordinates are the
  1881.         contents of the variables LRX and LRY. The box border will be the
  1882.         contents of BoxFore (red) on a background of BoxBack (black). The
  1883.         shadow color is the contents of the variable Shadow. See ClearBox
  1884.         command.
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.                                     Page 35
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.                                        BREAKON
  1911.  
  1912.  
  1913.         Provides a capability to exit from a PowerBatch program by pressing the
  1914.         combination of keys (Ctrl - Break) or (Ctrl - C). The default value
  1915.         set at the beginning of any PowerBatch program is BreakON. To keep a
  1916.         user from exiting a running PowerBatch program, execute the BreakOFF
  1917.         command. If sections of the program are to be protected and other
  1918.         sections not protected, surround the sections with pairs of
  1919.         BreakON...BreakOFF commands. See BreakOff command.
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.                                     Page 36
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.                                        BREAKOFF
  1964.  
  1965.         Disables the ability to stop a PowerBatch program by pressing the (Ctrl
  1966.         - Break) or (Ctrl - C) key combinations. The default value set at the
  1967.         beginning of any PowerBatch program is BreakON. See BreakOn command.
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.                                     Page 37
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.                              CENTER TextToCenter, LineNum
  2017.  
  2018.         TextToCenter is centered on LineNum. If LineNum is omitted, the
  2019.         current line is assumed. If imbedded color commands are present in
  2020.         TextToCenter, they are processed.
  2021.  
  2022.            Variable InpStr,25,"PowerBatch"
  2023.            Variable MenuLine,19,"@004M@007enu Line 1"
  2024.            Center   "PowerBatch",2
  2025.            Center   InpStr,2
  2026.            Center   MenuLine,14
  2027.  
  2028.         Both of the first two examples will center the text "PowerBatch" on line
  2029.         2. The third example will center the text "Menu Line 1" on line 14.
  2030.         The value of the variable MenuLine contains imbedded colors commands.
  2031.         Note that the character,"@" is used to signify ASCII 001, a non-
  2032.         printable character. Refer to the notes on imbedded color commands.
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.                                     Page 38
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.                                     CHDIR DirName
  2070.  
  2071.         DirName is made to be the current directory. If DirName contains a
  2072.         drive designation (i.e. C:\NEWDIR), a change will be made to the new
  2073.         drive prior to changing to the new directory.
  2074.  
  2075.            Variable Drive,3
  2076.            Variable Directory,79
  2077.            Write 'Enter new drive letter >'
  2078.            ReadKey  Drive
  2079.            Concat   Drive,':\'
  2080.            Write 'Enter new directory >'
  2081.            ReadStr  Directory
  2082.            Concat   Directory,Drive,Directory
  2083.            ChDir Directory
  2084.  
  2085.         The user is asked to enter a new drive and a new directory. These are
  2086.         then concatenated into the variable Directory. If the resulting value
  2087.         in Directory is "C:\NEWDIR", the ChDir command will change the logged
  2088.         (current default) drive to "C" and the logged directory to "\NEWDIR".
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.                                     Page 39
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.                  CLEAR FGrndClr, [,BGrndClr] [,ClearChar] [BorderClr]
  2123.  
  2124.         The current defined screen will be cleared. This may have been altered
  2125.         with a Window command, if so, only the defined window will be cleared.
  2126.         The screen will be cleared to FGrndClr, BGrndClr. If ClearChar is
  2127.         specified, the screen will be cleared to this character, else it will
  2128.         be cleared to spaces. If the current defined screen is 1,1,80,25; the
  2129.         border will be set to BorderClr. The border may be "cleared" to normal
  2130.         with a clear command with BorderClr set to black.
  2131.  
  2132.            Variable ColorAttr,3,112 ;define wht on black
  2133.            Clear ColorAttr      ;clear to composite color 112
  2134.            Clear 7,0,'░'     ;clear to white on black using
  2135.            ; the char ░ to create a
  2136.                           ; pattern
  2137.            Clear 4,0,,4      ;clear to red on black with
  2138.                           ; red border, no pattern
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.                                     Page 40
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.                   CLEARBOX UX,XY,LX,LY, FgClr, [BkgClr] [,ClearChar]
  2176.  
  2177.  
  2178.         Clear the interior of the box whose upper left coordinates (X,Y) are
  2179.         UX,UY and whose lower right coordinates (X,Y) are LX,LY. Clear the
  2180.         interior of the box to foreground color FgClr and background color
  2181.         BkgClr. This command clears the "inside" of the box, not the lines
  2182.         which describe the box. If ClearChar is specified, the interior of the
  2183.         box is propagated with the clear character.
  2184.  
  2185.            Variable ULX,2,5     ;upper left col value
  2186.            Variable ULY,2,3     ;upper left row value
  2187.            Variable LRX,2,75    ;lower right col value
  2188.            Variable LRY,2,20    ;lower right row value
  2189.            Variable BoxFore,2,4 ;foreground color red
  2190.            Variable BoxBack,2,0 ;background color black
  2191.            Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  2192.            ClearBox 5,3,75,20,112
  2193.  
  2194.         In this example we define the upper right and lower left coordinates
  2195.         of the box as well as the colors BoxFore and BoxBack. We draw the box
  2196.         with a red line on a black background. The ClearBox command clears the
  2197.         interior of the box to white on black.
  2198.  
  2199.            ClearBox ULX,ULY,LRX,LRY,BoxFore,BoxBack,'▓'
  2200.  
  2201.         This command clears the box to red on black and completely fills the
  2202.         box with the character "▓".
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.                                     Page 41
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.                     CLEARLINE LineNum, ForeGrndClr [,BackGrndClr]
  2229.  
  2230.         Clear the line number specified by LineNum to a foreground color of
  2231.         ForeGrndClr and a background color of BackGrndClr. The line number is
  2232.         relative to the top of the current window. If you have defined a
  2233.         window with one of the PowerBatch window commands, the ClearLine command
  2234.         will be relative to the top left of this current window.
  2235.  
  2236.            Variable    Red,1,4
  2237.            Variable    Blue,1,1
  2238.            Variable    RedOnBlue,2,20
  2239.            Variable    CurrLine,2,12
  2240.            ClearLine      12,Red,Blue
  2241.            ClearLine      CurrLine,RedOnBlue
  2242.  
  2243.         Both examples of the ClearLine command clear line 12 on the screen to
  2244.         red foreground color and blue background color.
  2245.  
  2246.            Window1     20,5,60,10,32
  2247.            ClearLine      3,26
  2248.  
  2249.         This command will clear the third line of the defined window (the
  2250.         eighth absolute line on the physical screen), i.e. the third line down
  2251.         from the top of the window.
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.                                     Page 42
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.                          COLOR ForeGroundClr [,BackgroundClr]
  2282.  
  2283.         Set the default system color to a foreground color of ForeGroundClr
  2284.         and to a background color of BackgroundClr or optionally set the
  2285.         system color to the composite color attribute ForeGroundClr.
  2286.  
  2287.            Variable RedOnBlue,2,20
  2288.            Color 4,1
  2289.            Color MenuClr
  2290.  
  2291.         Both examples set the default color to red on blue for any text
  2292.         written to the screen without specific color instructions.
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.                                     Page 43
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.                      COMPARE Value1, Value2, 1GR2,  1Less2, 1EQ2
  2335.  
  2336.         Compare the contents of Value1 to the contents of Value2. If Value1 is
  2337.         greater than Value2 jump to the Label 1GR2. If Value1 is less than
  2338.         Value2 jump to the label 1Less2. If Value1 is equal Value2 jump to the
  2339.         label 1EQ2. If the contents of the first two operands (Value1, Value2)
  2340.         are numeric then a numeric compare is performed otherwise an
  2341.         alphabetic compare is made. (If 19 is compared alphabetically to 2,
  2342.         then 2 is greater than 19; if it is compared numerically, 19 is
  2343.         greater than 2.)
  2344.  
  2345.            Variable InChar,1
  2346.            Variable Yes,1,"Y"
  2347.            Variable No,1,"N"
  2348.            GoToXY   4,23
  2349.            ReadYN   "Incorrect entry...Continue [Y/N] ",InChar
  2350.            Compare  InChar,"Y",NoIn,NoIn,YesIn
  2351.            Compare  InChar,Yes,,,YesIn   (Not Y falls through)
  2352.            Compare  InChar,"Y",NoIn,NoIn (Y falls through)
  2353.  
  2354.         In the first example, variable InChar is compared to literal "Y". If
  2355.         InChar is greater than "Y" then the program will jump to the label
  2356.         NoIn; if InChar is less than "Y", the program also jumps to the label
  2357.         NoIn; if InChar is equal to "Y", the program will continue processing
  2358.         at the label named YesIn. In the second compare, the variable InChar
  2359.         is compared to the variable Yes which has an assigned value of "Y". If
  2360.         InChar contains anything but "Y", the program continues with the next
  2361.         instruction after the compare command (it is said to fall through); if
  2362.         InChar contains "Y", the program will jump to the label YesIn. In the
  2363.         third compare command, variable InChar is compared to the literal "Y".
  2364.         If the variable InChar contains "N" (ReadYN prevents any entry but Y
  2365.         or N) the program jumps to the label NoIn otherwise it continues with
  2366.         the instruction after the compare command.
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.                                     Page 44
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.                           CONCAT Target, String1 [,String2]
  2388.  
  2389.         If String2 is omitted, String1 is appended to Target. If String2 is
  2390.         present, String2 is appended to String1 and the result replaces
  2391.         Target.
  2392.  
  2393.            Variable    OutMsg,78
  2394.            Variable    ErrMsg," is not a valid Drive letter."
  2395.            Variable    DriveLtr,1
  2396.            WriteAt     6,17,"Enter your source drive letter "
  2397.            ReadUpKey      DriveLtr
  2398.            ?DriveExist DriveLtr,DriveOK
  2399.            Concat      OutMsg, "[19] ", DriveLtr
  2400.            Concat      OutMsg, " is not a valid Drive letter."
  2401.            WriteAt     5,23,OutMsg
  2402.  
  2403.         In this example we ask the user to input a valid drive letter and
  2404.         verify this drive with the ?DriveExist command. If the drive is not
  2405.         valid we concatenate "[19]" (the error number) plus the drive letter
  2406.         entered by the user into the variable OutMsg. We then concatenate the
  2407.         error message (" is not a valid Drive letter.") onto the contents of
  2408.         OutMsg. The result would be something like "[19] L is not a valid
  2409.         Drive letter."
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.                                     Page 45
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.                                   CURSOR CursorType
  2441.  
  2442.         CursorType may be 1,2, 3 or 4. 1 = normal cursor; 2 = cursor off; 3 =
  2443.         fat cursor; 4 = block cursor. A "fat" cursor is the cursor shape
  2444.         normally seen when text is to be inserted. The block cursor fills the
  2445.         entire screen position. Remember to set the cursor back to normal at
  2446.         the end of a program if you have set the cursor off during the
  2447.         processing of your program. This is not automatically set back to
  2448.         normal when the program terminates.
  2449.  
  2450.            Variable Normal,1,1
  2451.            Variable Off,1,2
  2452.            Variable Fat,1,3
  2453.            Variable Block,1,4
  2454.  
  2455.            Cursor   Off
  2456.            Cursor   2
  2457.            Cursor   Fat,1
  2458.            Cursor   3
  2459.            Cursor   Block
  2460.            Cursor   4
  2461.            Cursor   Normal
  2462.            Cursor   1
  2463.  
  2464.         Each preceding pair of commands will have the same results. Off has a
  2465.         value of 2, Fat has a value of 3, etc.
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.                                     Page 46
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.                     DIVIDE Result, Divisor [,RtnCode] [,Decimals]
  2494.  
  2495.         If the divisor is less than 1 then Result is set to zero. Result is
  2496.         divided by Divisor and the result  of the division is placed in
  2497.         Result. If the division operation contained no errors, RtnCode will
  2498.         contain zero (0). The number of decimal places in the Result is
  2499.         specified in Decimals. If Decimals is not specified, zero decimal
  2500.         places will be assumed and integer arithmatic will be performed. Your
  2501.         result will be rounded to the number of specified decimal places.
  2502.         Accurate to 18 significant digits.
  2503.  
  2504.            Variable Result,18
  2505.            Variable RtnCode,1
  2506.  
  2507.            SetVar   Result,15
  2508.            Divide   Result,3    (Result now contains 5)
  2509.  
  2510.            SetVar   Result,'.000124'
  2511.            Divide   Result,'.00515',RtnCode,10
  2512.                     (Result contains 0.0240776699)
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.                                     Page 47
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.                                  ENHANCLR Mode
  2547.  
  2548.         The enhanced color command assigns new background colors to the color
  2549.         values above 127 (the blinking colors). The new colors have a
  2550.         background color which is identical to the foreground colors. Run the
  2551.         new COLORS utility to view the new color values.  Mode is either 0
  2552.         (off); or 1 (on). Enhanced colors may be switched on or off at any
  2553.         time and the current screen will be changed.
  2554.  
  2555.            Variable    On,1,1
  2556.            Variable    Off,1,0
  2557.  
  2558.  
  2559.            EnhanClr    On
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.                                     Page 48
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.                                        FLUSHKEY
  2600.  
  2601.         Removes all characters from the system keyboard buffer. After
  2602.         execution of this command, there will be no more characters waiting to
  2603.         be retrieved from the keyboard buffer. Use this command to eliminate
  2604.         the possibility of any "type ahead" characters being present in the
  2605.         buffer when you ask for input from the user.
  2606.  
  2607.            WriteLine   'CAUTION, You will now format your hard disk'
  2608.            FlushKey
  2609.            ReadYN   'Format hard Disk (Y/N)? ',InputChar
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.                                     Page 49
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.                                      GOTO Label1
  2652.  
  2653.         Jump to the statement identified as command label Label1. Program
  2654.         processing will go directly from this GoTo command to Label1 and
  2655.         continue with the command immediately following the label (since the
  2656.         label command is simply a placemarker).
  2657.  
  2658.            GoTo     Error
  2659.            GoTo  EndOfPgm
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.                                     Page 50
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.                                GOTOXY XCo-ord, YCo-ord
  2705.  
  2706.         Move the cursor to the column (X) specified in XCo-ord and row (Y)
  2707.         specified in YCo-ord.
  2708.  
  2709.            Variable CurrX,2
  2710.            Variable CurrY,2
  2711.            GoToXY   CurrX, CurrY
  2712.            GoToXY   12,6
  2713.  
  2714.         In the first example the cursor is moved to the location specified by
  2715.         the contents of variable CurrX and CurrY. In the second example, the
  2716.         cursor is moved to the location specified by two literals "12" and
  2717.         "6".
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.                                     Page 51
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.                                   HALT [ErrorLevel]
  2758.  
  2759.         Halt your PowerBatch program and set DOS errorlevel to ErrorLevel.
  2760.  
  2761.            Variable Error14,2,14   ;define Error14 as "14"
  2762.            Halt     99
  2763.            Halt     Error14
  2764.  
  2765.         In the first usage of the Halt command, the PowerBatch program is halted
  2766.         and the DOS errorlevel is set to 99. In the second usage the program
  2767.         is halted and the DOS errorlevel is set to the contents of variable
  2768.         Error14 ("14").
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.                                     Page 52
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.                                    LABEL LabelName
  2811.  
  2812.         Define a location in your source that will enable execution to begin
  2813.         immediately following the Label command without necessarily having
  2814.         executed the command immediately prior to the label. Jump immediately
  2815.         to this location in the command stream. See the discussion on labels
  2816.         at the beginning of this section.
  2817.  
  2818.            Label    MatchErr
  2819.            Label    EndOfPgm
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.                                     Page 53
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.            LOCSTR  StrToLookFor, StrToLookIn, [Occur] ,Loc [,Replace]
  2864.  
  2865.         Examine the string StrToLookIn for the string StrToLookFor. If Occur
  2866.         does not exist set Occur to 1. Look for the Occur occurrance of the
  2867.         string. If StrToLookFor is found, place the location of the first
  2868.         position of the string in Loc; if StrToLookFor is not found, place
  2869.         zero (0) in Loc. If Replace is present, replace StrToLookFor with
  2870.         Replace.
  2871.  
  2872.            Variable    StrLoc,3
  2873.            Variable    InPutStr,255,'This is a test string'
  2874.            LocStr      'is',InPutStr,,StrLoc
  2875.         StrLoc will contain 3 ("This" contains 'is'),
  2876.  
  2877.            LocStr      'is',InPutStr,2,StrLoc
  2878.         StrLoc will contain 6.
  2879.  
  2880.            LocStr      'test',InPutStr,,StrLoc,'text'
  2881.         StrLoc will contain 11 and InPutStr will be changed to "This is a text
  2882.         string".
  2883.  
  2884.            LocStr      'test',InPutStr,2,StrLoc,'text'
  2885.         StrLoc will contain 0 and InPutStr will not be changed. There is no
  2886.         second occurrance of "test".
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.                                     Page 54
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.                              LENGTH StringLength, String
  2917.  
  2918.         Calculate the length of the string in variable String and place the
  2919.         result in StringLength.
  2920.  
  2921.            Variable InString
  2922.            Variable StrLen
  2923.  
  2924.            WriteAt  12,14,"Enter your current directory "
  2925.            ReadStr  InString
  2926.  
  2927.         User enters c:\util.
  2928.  
  2929.            Length   StrLen, InString
  2930.  
  2931.         StrLen will contain 7, the length of "c:\util".
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.                                     Page 55
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.                                      LOWER String
  2970.  
  2971.         Change the alphabetic characters in the variable String to lower case.
  2972.  
  2973.            Variable InString,25
  2974.            ReadStr  InString
  2975.  
  2976.         User enters C:\UTIL.
  2977.  
  2978.            Lower InString
  2979.  
  2980.         Now contains c:\util.
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.                                     Page 56
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.                     MIDSTRING NewString, OldString, Offset, Length
  3023.  
  3024.         Create a NewString by extracting characters from OldString. Beginning
  3025.         with the Offset character of OldString, extract Length characters and
  3026.         create the new string.
  3027.  
  3028.            Variable Path,79
  3029.            WriteAt  1,2,"Enter Drive and Directory name "
  3030.            ReadStr  Path
  3031.  
  3032.         User enters C:\UTIL.
  3033.  
  3034.            MidString   Drive,Path,1,2
  3035.  
  3036.         Extract C: from C:\UTIL, making the newstring C:.
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.                                     Page 57
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.                     MULTIPLY Result, Number [,RtnCode] [,Decimals]
  3076.  
  3077.         Result is multiplied by Number and the result of the multiplication is
  3078.         placed in Result. If the Multiply operation completed without error,
  3079.         RtnCode will contain zero (0). The number of decimal places in the
  3080.         result is specified in Decimals. If Decimals is not specified, zero
  3081.         decimal places will be assumed and integer arithmatic will be
  3082.         performed. Your Result will be rounded to the number of decimal places
  3083.         specified.
  3084.  
  3085.            Variable Total,14
  3086.            Variable TaxRate,6,'.06875'
  3087.            Variable Tax,8
  3088.            Variable Units,4
  3089.            Variable Quantity,3
  3090.  
  3091.            SetVar   Total,Units          (124)
  3092.            Multiply Total,Quantity          (372)
  3093.            Write 'Your total quantity is '
  3094.            WriteLine   Total
  3095.            Multiply Total,Cost,RtnCode,2    (948.6)
  3096.            SetVar   Tax,Total               (948.6)
  3097.            Multiply Tax,TaxRate,RtnCode,2      (65.22)
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.                                     Page 58
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.                                         NORMAL
  3129.  
  3130.         Change the current color attribute(s) back to the definition prior to
  3131.         the execution of a BLINK or REVERSE command.
  3132.  
  3133.            Color 20    ;set default color to red on blue
  3134.            Blink       ;changes to blinking red on blue
  3135.            WriteAt  2,24,"Incorrect...re-enter!"
  3136.            Normal         ;resets color to 20
  3137.            Beep     800,8
  3138.            Wait     35    ;pause 3.5 seconds
  3139.            WriteAt  2,24,"                    "   ;clear msg
  3140.  
  3141.         This is an example of a typical error routine. The color attribute is
  3142.         changed to blinking with the Blink command. The error message is
  3143.         written and the color attribute is changed back to its original value
  3144.         with the Normal command. The speaker is "beeped" and after a wait of
  3145.         3.5 seconds, the error message is removed from the screen.
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.                                     Page 59
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.                     PRINT PrinterNumber, StringToPrint [,RtnCode]
  3182.  
  3183.  
  3184.         PrinterNumber is 1,2, or 3; this corresponds to LPT1, LPT2, and LPT3.
  3185.         The Print command will send the StringToPrint to the printer and WILL
  3186.         NOT append a carriage return/line feed. This allows you to build your
  3187.         print line with a series of Print statements and complete the line
  3188.         with a PrintLine statement to force a CR/LF. While RtnCode is not
  3189.         required, it is highly recommended. If RtnCode contains zero (0), your
  3190.         print operation was successful. If it is not zero, your print
  3191.         operation was not successful. The error code returned varies with the
  3192.         make of printer, but the following seem to be somewhat universal.
  3193.  
  3194.         RtnCode = 8.   Printer not in ready state (printer off line).
  3195.         RtnCode = 40.  Printer out of paper.
  3196.         RtnCode = 48.  Printer not connected or power not on.
  3197.  
  3198.            Variable    PrtLine,80
  3199.            Variable    RtnCode,3
  3200.            Variable    PrtError,,'Printer Error!!Check your printer'
  3201.  
  3202.            SetVar      PrtLine,''
  3203.            Print    1,PrtLine,RtnCode
  3204.            Compare     RtnCode,0,,,PrtReady
  3205.            Write    PrtError
  3206.            ReadKey     InKey
  3207.            Label PrtReady
  3208.            SetVar      PrtLine,InData
  3209.            Print    1,PrtLine,RtnCode
  3210.            Compare     RtnCode,0,,,NextLine
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.                                          Page 60
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.                   PRINTLINE PrinterNumber, StringToPrint [,RtnCode]
  3235.  
  3236.         PrinterNumber is 1,2, or 3; this corresponds to LPT1, LPT2, and LPT3.
  3237.         The PrintLine command will send the StringToPrint to the printer and
  3238.         WILL append a carriage return/line feed. While RtnCode is not
  3239.         required, it is highly recommended. If RtnCode contains zero (0), your
  3240.         print operation was successful. If it is not zero, your print
  3241.         operation was not successful. The error code returned varies with the
  3242.         make of printer, but the following seem to be somewhat universal.
  3243.  
  3244.         RtnCode = 8.   Printer not in ready state (printer off line).
  3245.         RtnCode = 40.  Printer out of paper.
  3246.         RtnCode = 48.  Printer not connected or power not on.
  3247.  
  3248.            Variable    PrtLine,80
  3249.            Variable    RtnCode,3
  3250.            Variable    PrtError,,'Printer Error!!Check your printer'
  3251.  
  3252.            SetVar      PrtLine,''
  3253.            Print    1,PrtLine,RtnCode    ;is the printer rdy?
  3254.            Compare     RtnCode,0,,,PrtReady
  3255.            Write    PrtError
  3256.            ReadKey     InKey
  3257.            Label PrtReady
  3258.            SetVar      PrtLine,InData
  3259.            PrintLine      1,PrtLine,RtnCode
  3260.            Compare     RtnCode,0,,,NextLine
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.                                     Page 61
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.                                        PRINTSCR
  3288.  
  3289.         The entire contents of the current screen is sent to the system
  3290.         printer. A page eject is automatically appended to the last character
  3291.         to cause the printer to eject the printed page.
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.                                     Page 62
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.                                  PROMPT NewPromptVal
  3341.  
  3342.         Change the current value of the prompt to the value specified in
  3343.         NewPromptVal.
  3344.  
  3345.            Prompt   "$P$G"
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.                                     Page 63
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.                               RANDOM UpperLimit, Result
  3394.  
  3395.         A random number is generated from (and including) zero through the
  3396.         UpperLimit. The random number is placed in Result.
  3397.  
  3398.            Variable RandNum,3
  3399.  
  3400.            Random   200,RandNum
  3401.  
  3402.         A random number between 0 and 200 inclusive will be generated.
  3403.  
  3404.            Label NewNumb
  3405.            Random   200,RandNum
  3406.            Compare  RandNum,100,,NewNumb
  3407.  
  3408.         This will generate a random number between 100 and 200.
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.                                     Page 64
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.                READKEY Target [,SpecInd] [,Tmeout] [,NoPrt] [,CtlChar]
  3447.  
  3448.         Read a single key from the keyboard and place the result in Target. If
  3449.         SpecInd contains a "1" after reading the key from the keyboard, then a
  3450.         "special key" has been returned in Target. Special keys are function
  3451.         keys, Page Up/Down, cursor movement keys, etc. If you are in doubt
  3452.         about a particular key, run the program "KEYID" (furnished on the
  3453.         install disk). Each key you press will be identified as either a
  3454.         regular key or a special key and the value that will be returned in
  3455.         Target when this key is pressed (remember that SpecInd will contain a
  3456.         "1" for special keys).
  3457.  
  3458.          The TmeOut parameter is used when you want to wait for a key from the
  3459.         keyboard, but continue processing without receiving the key after a
  3460.         specified number of seconds. Placing the number of seconds to wait in
  3461.         TmeOut will allow your program to "fall through" the ReadKey
  3462.         instruction if the timeout value is exceeded. If no input is received
  3463.         within TmeOut seconds, the null character (ASCII 0) is placed in
  3464.         Target and zero is placed in SpecInd.
  3465.  
  3466.         The NoPrt parameter gives you the option to have the entered character
  3467.         printed or not. The default is to print the character. If you wish to
  3468.         have the character not printed to the screen, place a one (1) in the
  3469.         NoPrt parameter.
  3470.  
  3471.         ReadKey gives you the capability to check for Non-ASCII keys (i.e.
  3472.         NumLock, Scroll Lock, etc.). Place one of the characters from the
  3473.         following table in the CtlChar parameter. If the requested key is
  3474.         pressed on the keyboard (or toggled on in the case of NumLock, Scroll
  3475.         Lock, and Caps Lock), ReadKey will return with SpecInd set to 2. No
  3476.         key will be returned in Target. Select one of these values to be
  3477.         placed in CtlChar:
  3478.            Right Shift #1    Left Shift     #2
  3479.            Ctrl        #4    Alt         #8
  3480.            Scroll Lock #16      Num Lock #32
  3481.            Caps Lock   #64      Insert      #128
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.                                     Page 65
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.                            Variable InKey,1
  3500.            Variable Spec,1
  3501.            Variable F10,1,#68
  3502.            Variable Caps,1,#64
  3503.  
  3504.            ReadKey  InKey          ;read a single key
  3505.  
  3506.            ReadKey  InKey,Spec
  3507.            Compare  Spec,1,Reg,Reg       ;fall thru if Spec=1
  3508.            Compare  InKey,F10,NotF10,NotF10 ;fall thru if F10
  3509.  
  3510.            ReadKey  InKey,Spec,10        ;wait 10 secs
  3511.            Compare  InKey,'',,,NoKey     ;InKey=null, timedout
  3512.  
  3513.            ReadKey  InKey,,,1            ;dont print the input
  3514.  
  3515.            ReadKey  InKey,Spec,,,Caps
  3516.            Compare  Spec,2,,,CapsOn      ;Spec=2, caps lock on
  3517.            Write 'Caps Lock is off'
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.                                     Page 66
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.                               READSTR Target [,TimeOut]
  3553.  
  3554.         Read a string of characters from the keyboard until the user presses
  3555.         the enter key. Any number of characters may be read up to the maximum
  3556.         length specified for Target in the Variable statement. If the TimeOut
  3557.         parameter is specified, wait the specified number of seconds before
  3558.         continuing without having received a key.
  3559.  
  3560.            Variable InString,12
  3561.            ReadStr  InString    ;12 chars max will be read
  3562.  
  3563.            Label ReadPass
  3564.            ReadStr  InString,10 ;Only wait 10 secs for input
  3565.            Compare  InString,'',InputOK
  3566.            WriteAt  12,24,'Please enter your password'
  3567.            GoTo     ReadPass
  3568.  
  3569.            Label InputOK
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.                                     Page 67
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.                              READUPKEY Target [,TimeOut]
  3606.  
  3607.         Read a single character from the keyboard, changing the case of any
  3608.         alphabetic character to upper case and place this upper case character
  3609.         in Target. If the TimeOut parameter is present, continue with the
  3610.         execution of the program after TimeOut seconds even if no character is
  3611.         entered.
  3612.  
  3613.            ReadUpKey   CharIn   ;read a single char in upper case
  3614.  
  3615.            WriteAt  16,24,'Enter your drive letter'
  3616.            ReadUpKey   CharIn,10      ;wait 10 seconds for a key
  3617.            Compare  CharIn,'',GotDrive,GotDrive
  3618.            SetVar   CharIn,'C'  ;supply default drive letter
  3619.  
  3620.            Label GotDrive
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.                                     Page 68
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.                      READYN Message, Target [,TimeOut][,NoPrint]
  3659.  
  3660.         Write the message found in Message at the current cursor location and
  3661.         wait for a single key to be entered from the keyboard. Force the user
  3662.         to enter either a "Y" or "N" and place the upper case "Y" or "N" in
  3663.         Target. If TimeOut is specified, wait only the specified number of
  3664.         seconds before continuing with the program without input. If the
  3665.         character entered is not to be printed, place a one (1) in NoPrint.
  3666.  
  3667.            Variable Msg4,35,"Invalid name...Continue [Y/N] "
  3668.            ReadYN   "Invalid name...Continue [Y/N] ",CharIn
  3669.  
  3670.            ReadYN   Msg4,CharIn
  3671.  
  3672.         In both usages of the ReadYN command, the message "Invalid
  3673.         filename...Continue [Y/N] " will be displayed and the program will
  3674.         wait for a response from the user. If the user enters any characters
  3675.         other than "Y", "y", "N", or "n" the system speaker will sound and the
  3676.         user is prompted again for input. At the completion of this command,
  3677.         the variable CharIn will contain either "Y" or "N" (always upper
  3678.         case).
  3679.  
  3680.            Label ErrMsg
  3681.            ReadYN   Msg4,CharIn,8
  3682.            Compare  CharIn,'',GotChar
  3683.            Beep     800,8
  3684.            GoTo     ErrMsg
  3685.  
  3686.         If the user does not enter a character within 8 seconds, the system
  3687.         speaker will be sounded and the user asked again for input.
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.                                     Page 69
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.                                        REVERSE
  3712.  
  3713.         Change the text attributes to "reverse video". This is accomplished by
  3714.         swapping the foreground and background attributes. This command is
  3715.         "undone" by using NORMAL.
  3716.  
  3717.            Color 20    ;red on black
  3718.            Reverse        ;color is changed to black on red
  3719.            WriteAt  1,15,"Press Escape To Continue"
  3720.            Normal         ;color is now red on black
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.                                     Page 70
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.                                      SCRMODE Mode
  3765.  
  3766.         Used for changing the screen mode to 43/50 lines per screen on
  3767.         monitors that have the capability to display in these modes. The mode
  3768.         shift will automatically detect either 43 or 50 lines and change to
  3769.         the proper mode. Mode 0 will switch from 43/50 to 25 lines per screen.
  3770.         Mode 1 will switch from 25 lines to 43/50 lines per screen.
  3771.  
  3772.            Variable 25Lines,1,0 ;define a var with value 0
  3773.            Variable 43Lines,1,1 ;define a var with value 1
  3774.  
  3775.            ScrMode     43Lines
  3776.            Perform     DisplayParms   ;display a file
  3777.            ScrMode     25Lines        ;return to normal screen display
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.                                     Page 71
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.                            SETENV EnvironName EnvironValue
  3818.  
  3819.         The environment variable named EnvironName will have its value changed
  3820.         to EnvironValue. Error messages will occur if the size of the new
  3821.         value minus the size of the old value is greater than the number of
  3822.         free bytes of environment space available.
  3823.  
  3824.            Variable    VarName,7,"MONITOR"
  3825.            Variable VarValue,5,"color"
  3826.  
  3827.            SetEnv   VarName, VarValue
  3828.            SetEnv   "Monitor","color"
  3829.  
  3830.         Both examples will change the environment variable "Monitor" to have a
  3831.         value of "color".
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.                                     Page 72
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.                                    SETPATH NewPath
  3871.  
  3872.         The current PATH environment variable will have its value changed to
  3873.         NewPath. Error messages will occur if the size of the new path value
  3874.         minus the size of the old value is greater than the number of free
  3875.         bytes of environment space available.
  3876.  
  3877.            Variable NewPath,40,"d:\;c:\util\exec;c:\wp\letters"
  3878.  
  3879.            SetPath  NewPath
  3880.            SetPath  "d:\;c:\;"
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.                                     Page 73
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.                               SETVAR VariableName, Value
  3924.  
  3925.         Set the value of VariableName to the contents of Value. A variable
  3926.         cannot be set to a value greater in length than the  maximum length
  3927.         parameter in the Variable definition.
  3928.  
  3929.            Variable ErrCode,3
  3930.            Variable FileName,79
  3931.  
  3932.            SetVar   ErrCode,99
  3933.            SetVar   FileName,"C:\CONFIG.SYS"
  3934.  
  3935.         In the first usage of the SetVar command, the variable ErrCode is set
  3936.         to "99" and the second usage sets the variable FileName to
  3937.         "C:\CONFIG.SYS".
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.                                     Page 74
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976.                     SUBTRACT Total, Number [,RtnCode] [,Decimals]
  3977.  
  3978.         Subtract the contents of Number from the contents of Total and place
  3979.         the result in Total. If the subtract operation completed without
  3980.         error, RtnCode will contain zero (0). The number of decimals in Total
  3981.         is specified in Decimals. If Decimals is not specified, zero decimal
  3982.         places will be assumed and integer arithmatic will be performed. The
  3983.         Total is rounded to the specified number of decimal places.
  3984.  
  3985.            Variable TotalLines,2,25
  3986.            Variable RtnCode,1
  3987.  
  3988.            Subtract TotalLines,1
  3989.            Compare  RtnCode,0,ErrRoutine
  3990.  
  3991.         Subtract the constant "1" from the variable "TotalLines" and place the
  3992.         result in TotalLines.
  3993.  
  3994.         Using decimal arithmatic in PowerBatch...
  3995.  
  3996.            Variable TotAmt,12
  3997.            Variable TaxAmt,10
  3998.  
  3999.            SetVar   TaxAmt,TotAmt
  4000.            Multiply TaxAmt,'.025',RtnCode,3
  4001.            Subtract TotAmt,TaxAmt,RtnCode,2
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.                                     Page 75
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.                       TRIM  StrToChg [,Indicator] [,CharToTrim]
  4030.  
  4031.         StrToChg is the string to be "trimmed". Indicator is (L)eft, (R)ight,
  4032.         or (B)oth indicating which end of the string is to be trimmed. If
  4033.         Indicator is not specified, (R)ight will be assumed. CharToTrim is the
  4034.         character which will be trimmed from the string. If no CharToTrim is
  4035.         specified, blanks will be trimmed from the string.
  4036.  
  4037.            Variable    InString,80
  4038.  
  4039.            ReadFile    'INPUT',InString
  4040.            Trim        InString
  4041.  
  4042.         If there are any trailing blanks read from the file, the Trim command
  4043.         will eliminate these trailing blanks. (No character was specified and
  4044.         blank was assumed; no indicator was specified and Right was assumed.
  4045.  
  4046.            Variable    Total,11
  4047.            Variable    Left,1,'L'
  4048.            Variable    Zero,1,'0'
  4049.  
  4050.            Trim        Total,Left,Zero
  4051.  
  4052.         Here the Trim command is used to remove leading (left end) zeros from
  4053.         a numeric field.
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.                                     Page 76
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.                                   UPPER VariableName
  4083.  
  4084.         Change all the alphabetic characters in VariableName to upper case.
  4085.  
  4086.            Variable InString,25
  4087.            WriteAt  14,25,"Enter your directory name "
  4088.            ReadStr  InString       (user enters c:\util)
  4089.            Upper    InString    (changed to C:\UTIL)
  4090.            ?InPath  InString,GoodDir  (path is always upper case)
  4091.  
  4092.         In this example, the user is prompted for a path name to be entered.
  4093.         The path name is to be compared to the system path for validity. Since
  4094.         the contents of the system path are always in upper case, we change
  4095.         the InString variable to upper case prior to comparison.
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.                                     Page 77
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.                    VARIABLE VariableName, MaxLength [,InitialValue]
  4136.  
  4137.         Define a variable to be used in a PowerBatch program. The variable will
  4138.         have a maximum length of MaxLength and an initial value of
  4139.         InitialValue. The initial value may be either an alphabetic value, a
  4140.         numeric value, or an ASCII value. An initial value which is alphabetic
  4141.         must be enclosed in either single or double quotes. A numeric initial
  4142.         value may be defined with or without quote delimiters but a convention
  4143.         of no quotes is a recommended technique. An  ASCII value is expressed
  4144.         as #nnn where nnn is the decimal value of the ASCII character. A
  4145.         variable may be of any length from 1 through 255. The initial value
  4146.         may be of any length from 1 through the MaxLength. VariableName is the
  4147.         name which you give to this variable and the means by which you refer
  4148.         to the variable in other PowerBatch commands.  See the discussion on
  4149.         variables at the beginning of this section.
  4150.  
  4151.         The special variables CLP%1 - CLP%16 are used to receive Command line
  4152.         parameters passed to a compiled PowerBatch program. Any command line
  4153.         parameters will be found in these  special parameters only.  Any
  4154.         number of parameters up to the max of 16 may be passed.
  4155.  
  4156.         Define a variable with no initial value.
  4157.            Variable DayOfWeek,9
  4158.  
  4159.         Define an alpha variable with an initial value.
  4160.            Variable ErrMsg1,25,"Invalid directory name."
  4161.  
  4162.         Define a variable with an initial numeric value of 50.
  4163.            Variable PauseTime,2,50
  4164.  
  4165.         Define a variable as a single ASCII value.
  4166.            Variable RightArrow,1,#26
  4167.  
  4168.         Define a variable as a string of ASCII values.
  4169.            Variable DblLine,5,#205#205#205#205#205
  4170.  
  4171.         Define a variable to receive a command line parameter.
  4172.            Variable CLP%1,12
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.                                     Page 78
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.                                 WAIT TimeToWait
  4189.  
  4190.         Cause the execution of a PowerBatch program to pause for a specified
  4191.         amount of time. TimeToWait is expressed in tenths of a second.
  4192.  
  4193.            Variable PauseTime,2,50
  4194.            Wait     5     (pause half a second)
  4195.            Wait     PauseTime   (pause 5 seconds)
  4196.            Wait     35    (pause 3.5 seconds)
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.                                     Page 79
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.                   WINDOW0-3 UpX,UpY,LoX,LoY,FGClr [,BKClr]
  4242.                   WINDOW4 UpX,UpY,LoX,LoY,FGClr [,BKClr] [,ShadClr]
  4243.  
  4244.         A virtual screen is defined with the boundaries UpX, UpY, LoX, LoY.
  4245.         The color attributes for this new screen are set to FGClr, BKClr. The
  4246.         area enclosed within this new screen is not cleared. Each window type
  4247.         has a different frame drawn around the window.
  4248.  
  4249.            Window0     No frame
  4250.            Window1     Single line
  4251.            Window2     Double line
  4252.            Window3     Heavy line
  4253.            Window4     Single line with shadow
  4254.  
  4255.         The cursor is positioned in the upper left corner of the window
  4256.         (location 1,1 for the new screen). This virtual screen will wrap at
  4257.         the new column boundaries and scroll at the new row boundaries. This
  4258.         screen appears in every way to DOS as the full size of the screen.
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.                                     Page 80
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.                       WRITE StringToWrite [,ForeClr] [,BackClr]
  4295.  
  4296.         Write the string contained in StringToWrite at the current cursor
  4297.         location using foreground color attribute ForeClr and background color
  4298.         attribute BackClr. In the absence of ForeClr and BackClr use the
  4299.         current color attributes. If the string contains imbedded color
  4300.         attributes, change the colors in the string according to these values.
  4301.         (See Imbedded Color Commands). The string is not followed by a
  4302.         carriage return, line feed pair (i.e. the cursor is not moved to the
  4303.         first position of the next line).
  4304.  
  4305.         Write the string "Enter your password" in black on white.
  4306.            Write "Enter your password ",0,7
  4307.  
  4308.         Write "Invalid directory name" contained in a variable using the
  4309.         composite color 112, also contained in a variable.
  4310.            Variable ErrMsg1,25,"Invalid directory name."
  4311.            Variable ErrClr,3,112
  4312.            Write ErrMsg1,ErrClr
  4313.  
  4314.         Write the string "Menu of choices" with the "M" in Menu written in
  4315.         color 112 and the remainder of the string written in  color 31.
  4316.            Variable MenuTitle,23,'@112M@031enu of choices'
  4317.            Write MenuTitle
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.                                     Page 81
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.                  WRITEAT XLoc, YLoc, StringVal [,ForeClr] [,BackClr]
  4348.  
  4349.         Write the value contained in StringVal at column location contained in
  4350.         XLoc and at row location contained in YLoc using the foreground color
  4351.         attribute contained in ForeClr and the background color attribute
  4352.         contained in BackClr. In the absence of ForeClr and BackClr, use the
  4353.         current color attributes. The string is not followed by a carriage
  4354.         return, line feed pair (i.e. the cursor is not moved to the first
  4355.         position of the next line).
  4356.  
  4357.            Variable TitleClr,3,112
  4358.            Variable CurrX,2
  4359.            Variable CurrY,2
  4360.            Variable CompName,25,"The ABC Company"
  4361.            WriteAt  15,3,"The ABC Company",TitleClr
  4362.            WriteAt  CurrX,CurrY,CompName
  4363.  
  4364.         In the first usage of the WriteAt command, the literal "The ABC
  4365.         Company" is written at column 15, row 3. In the second usage, the
  4366.         contents of the variable CompName ("The ABC Company") is written at
  4367.         the column location specified by the contents of variable CurrX and at
  4368.         the row location specified by the contents of variable CurrY.
  4369.  
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.                                     Page 82
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.                         WRITELINE StringToWrite [,LineNumber]
  4401.  
  4402.         Write the string contained in StringToWrite beginning at position 1 of
  4403.         the line number specified in LineNumber. Follow the string with a
  4404.         carriage return line feed pair (i.e. move the cursor to the first
  4405.         position of the next line). In the absence of LineNumber write the
  4406.         string at the current cursor location. Expand any imbedded color
  4407.         commands in the string. (See note below on imbedded color commands).
  4408.  
  4409.            WriteLine "Please read these instructions ",7
  4410.  
  4411.         The message "Please read these instructions " is written beginning in
  4412.         column 1 of row 7. Follow the string with a CR/LF.
  4413.  
  4414.            WriteLine Msg5
  4415.  
  4416.         Write the contents of the variable Msg5 beginning at the current
  4417.         cursor location. Follow the string with a CR/LF.
  4418.  
  4419.            Write "Enter the letter of the selected drive > "
  4420.            ReadKey  InKey
  4421.            WriteLine   ""
  4422.  
  4423.         Write the string "Enter the letter of the selected drive > ", leaving
  4424.         the cursor positioned at the end of this message (the Write command
  4425.         does not supply a CR/LF. After receiving the entry from the user,
  4426.         position the cursor at the beginning of the next line by "writing" to
  4427.         the screen a null string (two quote marks without any character
  4428.         between) using the WriteLine command. This will write to the screen
  4429.         only a CR/LF.
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.                                     Page 83
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.                                   STANDARD VARIABLES
  4454.  
  4455.         There are several variables which are in every PowerBatch program. These
  4456.         Standard Variables may be referenced without having to define them
  4457.         with a Variable command.
  4458.  
  4459.                 DispAdapter - This 4 character variable will contain a code describing
  4460.            the type of display controller card located in your system. If the
  4461.            first character contains "M", the adapter is a monochrome adapter.
  4462.            If the first character contains "C", the adapter is a color
  4463.            adapter. The remaining 3 characters may contain:
  4464.                  MDA-Monochrome Display Adapter
  4465.                  CGA-Color Graphics Adapter
  4466.                  EGA-Extended Graphics Adapter
  4467.                  VGA-Video Graphics Array
  4468.                  MGA-Multi-color Graphics Array
  4469.               If no video adapter is found the field will contain "NONE".
  4470.  
  4471.                 DOSError - If the external program which you execute sets a DOS error
  4472.            code, the error code will be placed in this variable.
  4473.  
  4474.                 DOSVer - This field will contain a 4 character code for the version of
  4475.            DOS installed. The first two characters are the major version and
  4476.            the last two the minor version. DOS 6.0 will be reported as 0600.
  4477.  
  4478.                 ErrorLevel - If the external program which you execute sets an
  4479.            ErrorLevel and that ErrorLevel is returned to PowerBatch by DOS, it
  4480.            will be placed in this variable.
  4481.  
  4482.                 ParallelPorts - This variable will contain the number of parallel ports
  4483.            supported by your hardware.
  4484.  
  4485.                 SerialPorts - This variable will contain the number of serial ports
  4486.            supported by your hardware.
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500.                                     Page 84
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.                                 Command Summary
  4507.  
  4508.         ?Color      Foreground Background Composite
  4509.         ?CurrDir    CurrDrive CurrDirectory
  4510.         ?Date       DayOfWeek Month Day Year
  4511.         ?DirExist   DirName FoundLbl [NotFoundLbl]
  4512.         ?DiskInfo   DriveLetter VolID DriveType
  4513.         ?DiskSpace  DriveLetter TotalSpace FreeSpace
  4514.         ?DriveExist DriveLetter ValidLabel [InvalidLabel]
  4515.         ?EnvStr     EnvironName EnvironNameContents
  4516.         ?FileExist  FileName FoundLabel [NotFoundLabel]
  4517.         ?FileExpan  FileName FoundLabel [NotFoundLabel]
  4518.         ?FileSize   FileSize FileName
  4519.         ?Inpath     DirName FoundLabel [NotFoundLabel]
  4520.         ?Time       CurrentTime
  4521.         Add         Sum Number [RtnCode] [Decimals]
  4522.         Beep        Frequency Duration [Repeat]
  4523.         Blink
  4524.         Boot
  4525.         Box0-3      Ux Uy Lx Ly ForeClr [BackClr]
  4526.         Box4        Ux Uy Lx Ly ForeClr [BackClr] [ShadowClr]
  4527.         BreakOn
  4528.         BreakOff
  4529.         Center      TextToCenter LineNum
  4530.         ChDir       DirName
  4531.         Clear       FgrndClr [BgrndClr] [ClearChar] [BorderClr]
  4532.         ClearBox    Ux Uy Lx Ly FgClr [BkgClr] [ClearChar]
  4533.         ClearLine   LineNum ForeGrndClr [BackgrndClr]
  4534.         Color       ForeGroundClr [BackGroundClr]
  4535.         Compare     Value1 Value2 1GR2 [1Less2] [1Eq2]
  4536.         Concat      Target String1 [String2]
  4537.         Cursor      CursorType (1=Normal,2=Off,3=Fat,4=Block)
  4538.         Divide      Result Divisor [RetCode] [Decimals]
  4539.         EnhanClr    Mode
  4540.         GoTo        Label
  4541.         GoToXY      XCo-ord YCo-ord
  4542.         Halt        [ErrorLevel]
  4543.         Label       LabelName
  4544.         Length      StringLength String
  4545.         LocStr      LookFor LookIn [Occur] Loc [Replace]
  4546.         Lower       String
  4547.         MidString   NewString OldString Offset Length
  4548.         Multiply    Result Number [RtnCode] [Decimals]
  4549.         Normal
  4550.         Print       PrinterNum StrToPrint [RtnCode]
  4551.  
  4552.  
  4553.                                     Page 85
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.         PrintLine   PrinterNum StrToPrint [RtnCode]
  4560.         PrintScr
  4561.         Prompt      NewPromptVal
  4562.         Random      UpperLimit Result
  4563.         ReadKey     Target [SpecInd] [Timeout] [NoPrt] [CtlChar]
  4564.         ReadStr     Target [Timeout]
  4565.         ReadUpKey   Target [Timeout]
  4566.         ReadYN      Message Target [Timeout] [NoPrt]
  4567.         Reverse
  4568.         ScrMode     Mode
  4569.         SetEnv      EnvironName EnvironValue
  4570.         SetPath     NewPath
  4571.         SetVar      VariableName Value
  4572.         Subtract    Total Number [RtnCode] [Decimals]
  4573.         Trim        StrToTrim [Indicator] [CharToTrim]
  4574.         Upper       VariableName
  4575.         Variable    VariableName MaxLength [InitialValue]
  4576.         Wait        TimeToWait (in tenths of a second)
  4577.         Window0-3   UpX UpY LoX LoY FgClr [BkClr]
  4578.         Window4     UpX UpY LoX LoY FgClr [BkClr] [ShadClr]
  4579.         Write       StringToWrite [ForeClr] [BackClr]
  4580.         WriteAt     XLoc YLoc StringVal [ForeClr] [BackClr]
  4581.         WriteLine   StringToWrite [LineNumber]
  4582.  
  4583.         Standard Variables
  4584.  
  4585.         DispAdapter Current display adapter
  4586.         DOSError Last DOS error code
  4587.         DOSVer      Running DOS version
  4588.         ErrorLevel  Last DOS errorlevel
  4589.         ParallelPorts  Num of parallel ports in running machine
  4590.         SerialPorts Num of serial ports in running machine
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.                                     Page 86
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.                                Compilation Errors
  4613.  
  4614.         Compilation errors are printed on the screen and also written in a
  4615.         file named ProgName.MAP where ProgName is the name of the program you
  4616.         have just compiled (If you have a split screen editor, view the source
  4617.         in one screen part and the errors in the other part). If the source
  4618.         line is available, the source line is printed above the error preceded
  4619.         by the line number count. Source lines are not available during the
  4620.         second pass of the compiler which may generate "Label not defined" and
  4621.         "Variable not defined" errors.
  4622.  
  4623.               "Not a valid command" - This error is generated when the first
  4624.               word on the command line is not a PowerBatch command and contains
  4625.               more than 8 characters.
  4626.  
  4627.               Example:
  4628.               13 Directory name checked here.
  4629.               [DIRECTORY] Not a valid command
  4630.  
  4631.                                Probably should be
  4632.               ;Directory name checked here
  4633.  
  4634.               "Missing variable" - A command contains less than the required
  4635.               number of operands.
  4636.  
  4637.               Example:
  4638.               21 ?Color   ForeColor,BackColor
  4639.               [] Missing variable
  4640.  
  4641.               Variable for the composite color byte is missing.
  4642.  
  4643.               "Expected a variable Name" - A string was found in an operand that
  4644.               may contain only a variable name.
  4645.  
  4646.               Example:
  4647.               10 ?Time "Current Time"
  4648.               [Current Time] Expected a variable name
  4649.  
  4650.               The current time may only be placed in a variable.
  4651.  
  4652.              "Quoted literal not terminated" - A single quote was encountered
  4653.               within a source line.
  4654.  
  4655.               Example:
  4656.               9 Center "Move Command,5
  4657.  
  4658.  
  4659.                                     Page 87
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.                  [] Quoted literal not terminated
  4666.  
  4667.               Closing quote should precede comma.
  4668.  
  4669.               "Invalid max length specified" - The second operand of a variable
  4670.               definition should specify the maximum length of the variable.
  4671.               The value found was not numeric.
  4672.  
  4673.               Example:
  4674.               3 Variable  CompName,"The ABC Company"
  4675.                 [The ABC Company] Invalid max length specified
  4676.  
  4677.              "Variable not defined" - A reference to a variable was made in the
  4678.               source file but the variable was not defined with the Variable
  4679.               command.
  4680.  
  4681.               Example:
  4682.               [CURRDATE] Variable not defined
  4683.  
  4684.               "Duplicate variable" - The same variable name has appeared 2 or
  4685.               more times in a Variable definition statement.
  4686.  
  4687.               Example:
  4688.               7 Variable  CompName,25
  4689.               [COMPNAME] Duplicate variable
  4690.  
  4691.               "Duplicate label" - The same label name has appeared 2 or more
  4692.               times in a Label definition statement.
  4693.  
  4694.               Example:
  4695.               16 Label    Step2
  4696.               [STEP2] Duplicate label
  4697.  
  4698.               "Invalid hex definition in variable" - A variable definition
  4699.               contained a # not enclosed in quotes signifying a value
  4700.               definition by ASCII value. The characters following this # were
  4701.               not numeric or did not equate to an ASCII character.
  4702.  
  4703.               Example:
  4704.               Variable Return,2,#J#219
  4705.  
  4706.                  #J is not valid
  4707.  
  4708.               "External command >" - This is not an error message, but is a
  4709.               check to alert you to each command found in a PowerBatch source
  4710.  
  4711.  
  4712.                                     Page 88
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.               file that will be treated as an external command. External
  4719.               commands are DOS intrinsic commands, .COM, and .EXE commands or
  4720.               programs (even PowerBatch compiled programs) and .BAT (standard
  4721.               DOS batch files) that are to be executed by PowerBatch.
  4722.  
  4723.               Example:
  4724.               External command > 12 DIR  (DOS directory command)
  4725.               External command > 29 MYPROG (Exe module MYPROG)
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.                                     Page 89
  4766.  
  4767.  
  4768.  
  4769.  
  4770.  
  4771.                                     Examples
  4772.  
  4773.         The source for several examples is contained on your installation
  4774.         disk. You may print these examples by entering:
  4775.  
  4776.            COPY INQUIRE.PWR LPT1
  4777.  
  4778.         These examples may be compiled using the PBPLUS command by entering a
  4779.         command similar to:
  4780.  
  4781.            PBPLUS INQUIRE <enter>
  4782.  
  4783.         This compiles the source for INQUIRE.
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.                                          Page 90
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.                                IMBEDDED COLOR COMMANDS
  4825.  
  4826.         A literal or a variable may be defined which has color commands
  4827.         imbedded in the text of the literal allowing you to change the color
  4828.         in the middle of the string to be printed. If you were creating a
  4829.         tutorial and wanted a menu at the bottom of the screen that gave the
  4830.         user several command choices and you wanted this menu to have the
  4831.         first character of each command in reverse video, PowerBatch provides a
  4832.         means to accomplish this easily. Suppose the command line is:
  4833.  
  4834.            Next Prev Load ........
  4835.  
  4836.         and the N, P, and L were to be in reverse video you would define the
  4837.         variable (or literal) as:
  4838.  
  4839.            Variable Cmd,75,"@112N@007ext @112P@007rev @112L@007oad"
  4840.  
  4841.         IN THIS EXAMPLE THE @ REPRESENTS CTRL-A BECAUSE OUR PRINTER WILL NOT
  4842.         PRINT A CTRL-A!
  4843.  
  4844.         The syntax for imbedded color commands is Ctrl-A followed by the THREE
  4845.         digit color attribute. Thus @112 means change the color to 112 and
  4846.         continue printing in this color until another change is made. Further
  4847.         examining the line...@112N@007ext means change to color 112, print N,
  4848.         change to color 007, print ext (Next).
  4849.  
  4850.         The ASCII value of Ctrl-A is 001. Most text editors will allow you to
  4851.         enter an ASCII character by entering the actual ASCII value by
  4852.         pressing the Alt key and entering the ASCII value on the numeric
  4853.         keypad (not the numbers above the character keyboard). Thus entering
  4854.         Ctrl-A becomes as simple as pressing Alt-1.
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.                                          Page 91
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.                              Composite Color Values
  4878.  
  4879.                              Color Names And Their Values
  4880.  
  4881.         Black (Blk)    0     Dk. Gray (DGy)    8
  4882.         Blue (Blu)     1     Lt. Blue (LBl)    9
  4883.         Green (Grn)    2     Lt. Green(LGr)    10
  4884.         Cyan (Cyn)     3     Lt. Cyan (LCy)    11
  4885.         Red (Red)      4     Lt. Red (Lrd)     12
  4886.         Magenta (Mag)  5     Lt. Magenta (LMg) 13
  4887.         Brown (Brn)    6     Yellow (Yel)      14
  4888.         Lt. Gray (LGy) 7     White (Wht)       15
  4889.  
  4890.         On the following page is two tables which give the ASCII value for the
  4891.         composite color byte (the single byte DOS uses to identify the current
  4892.         color). This single value is a composite of the two values for the
  4893.         background and foreground color values.  To arrive at the composite
  4894.         value multiply the background color value by 16 and add the foreground
  4895.         color value. Some examples will help explain:
  4896.            Red on Blue
  4897.            (Blue * 16) + Red = 20        (001 * 16) + 4 = 20
  4898.  
  4899.            White on Red
  4900.            (Red * 16) + White = 79       (004 * 16) + 15 = 79
  4901.  
  4902.         Verify these composite calculations by finding the corresponding
  4903.         values in the tables on the next page. To find Red on Blue, find the
  4904.         background color down the left side of the table and the foreground
  4905.         color across the top. Blue is the second color down and Red the fifth
  4906.         color across; at this intersection you will find the value 020.
  4907.         (Remember the color values begin with zero). Red is the fifth color
  4908.         down and White is the 16 color across; at this intersection is value
  4909.         079.
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.                                          Page 92
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.                           Normal (non-blinking) Colors
  4931.  
  4932.  
  4933.             Blk Blu Grn Cyn Red Mag Brn LGy DGy LBl LGr LCy LRd LMg Yel Wht
  4934.         Blk 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015
  4935.         Blu 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031
  4936.         Grn 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047
  4937.         Cyn 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063
  4938.         Red 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079
  4939.         Mag 080 081 082 083 084 085 986 087 088 089 090 091 092 093 094 095
  4940.         Brn 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111
  4941.         Gry 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
  4942.  
  4943.         Colors Which Blink
  4944.  
  4945.  
  4946.             Blk Blu Grn Cyn Red Mag Brn LGy DGy LBl LGr LCy LRd LMg Yel Wht
  4947.         Blk 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
  4948.         Blu 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
  4949.         Grn 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
  4950.         Cyn 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
  4951.         Red 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
  4952.         Mag 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
  4953.         Brn 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
  4954.         Gry 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.                                          Page 93
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.         Border Color 40                      SetEnv 72
  4984.         Box 34, 35                         SetVar 74
  4985.         Box With Shadow 35                 ERRORLEVEL 13, 52, 84
  4986.         Case                               External Commands 12, 89
  4987.           Lower 56                         Field length
  4988.           Upper 68, 77                       maximum 67
  4989.         CD, ChDir 39                       File exists 25, 26
  4990.         Center A Line Of Text 38           File Size 27
  4991.         Color attribute 16, 17, 59         FileName
  4992.         Command Line Parameters 14, 78       Does It Exist 25
  4993.         Command Notation 15                  Full Path Name 26
  4994.         Command Summary 85                 Flush Keyboard 49
  4995.         Command Syntax 16                  Frame 34, 35
  4996.         Comments 9                         Imbedded Colors 91
  4997.         Compare                            Installation 6
  4998.           alphabetic 44                    Interior of a box 41
  4999.           numeric 44                       Introduction 1
  5000.         Compilation Errors 87              Keyboard Input
  5001.         Composite Color Values 92            ReadKey 65
  5002.         Concatenate Strings 45               ReadStr 67
  5003.         Concept Of Operation 4               ReadUpKey 68
  5004.         Ctrl - Break 36                      ReadYN 69
  5005.         Current Date 19                    Labels 11
  5006.         Current Directory 18               License Agreement 1
  5007.         Current Drive 18                   Literals 9, 10
  5008.         Current Time 29                    Monitor Type 84
  5009.         Cursor Postion 51                  ParallelPorts 84
  5010.         Directory 20                       Passing Parameters
  5011.         Directory Exists 20                  14
  5012.         Directory, Change to new 39        PATH 15
  5013.         Disk capacity 22                     Is Dir In 28
  5014.         Disk Drive                           SetPath 73
  5015.           Valid Letter 23                  Pause 79
  5016.         Disk Space                         Pause A Program 79
  5017.           Free 22                          PBPlus Commands
  5018.           Total 22                           ?Color 17
  5019.         DOS errorlevel 52                    ?CurrDir 18
  5020.         DOS search path 28                   ?Date 19
  5021.         DOS Version 84                       ?DirExist 20
  5022.         DOSERROR 13, 84                      ?DiskInfo 21
  5023.         Drive Type 21                        ?DiskSpace 22
  5024.         Drive, Change to new 39              ?DriveExist 23
  5025.         Environment Variables 14             ?EnvStr 24
  5026.           Contents 24                        ?FileExist 25
  5027.  
  5028.  
  5029.  
  5030.                                          Page 94
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.                                              ?FileExpand 26                                                                        Upper 77
  5037.           ?FileSize 27                       Variable 78
  5038.           ?InPath 28                         Wait 79
  5039.           ?Time 29                           Window 80
  5040.           Add 30                             Write 81
  5041.           Beep 31                            WriteAt 82
  5042.           Blink 32                           WriteLine 83
  5043.           Boot 33                          PROMPT 15
  5044.           Box 34, 35                       Random Numbers 64
  5045.           BreakOff 37                      Screen
  5046.           BreakOn 36                         Clear 40
  5047.           Center 38                          Color 43
  5048.           ChDir 39                         Screen Window 80
  5049.           Clear 40                         SerialPorts 84
  5050.           ClearBox 41                      SETENV 15
  5051.           ClearLine 42                     SETPATH 15
  5052.           Color 43                         Software Support 3
  5053.           Compare 44                       Standard Variables
  5054.           Concat 45                          DispAdapter 84
  5055.           Cursor 46                          DOSError 84
  5056.           Divide 47                          DOSVer 84
  5057.           FlushKey 49                        ErrorLevel 84
  5058.           GoTo 50                            ParallelPorts 84
  5059.           GoToXY 51                          SerialPorts 84
  5060.           Halt 52                          String length 55
  5061.           Label 53                         Syntax
  5062.           Length 55                          Compilation 7
  5063.           Lower 56                         System speaker 31
  5064.           MidString 57                     Time, Current 29
  5065.           Multiply 58                      Trademarks 1
  5066.           Normal 59                        Variable map 7
  5067.           PrintScr 62                      Variables 9
  5068.           Prompt 63                          Value Of 74
  5069.           Random 64                        Virtual Window 80
  5070.           ReadKey 65                       Volume ID 21
  5071.           ReadStr 67                       Window 80
  5072.           ReadUpKey 68                     ReadYN 69
  5073.           Reverse 70
  5074.           ScrMode 71
  5075.           SetEnv 72
  5076.           SetPath 73
  5077.           SetVar 74
  5078.           Subtract 75
  5079.  
  5080.  
  5081.  
  5082.                                          Page 95
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.         This page intentionally left blank for your notes...
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.  
  5120.  
  5121.  
  5122.  
  5123.  
  5124.  
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.                                          Page 96
  5136.